You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -75,47 +77,44 @@ The default Jackson `ModelResolver` supports schema definitions via `@Schema` to
75
77
### Using `@Schema`
76
78
77
79
The `@Schema` annotation allows to set many properties like `description`, `example`, `requiredMode`, `minimum` to document payloads.
78
-
79
-
All properties are part of the produced AsyncAPI file. However, not all are displayed in `springwolf-ui` (see [#378](https://github.com/springwolf/springwolf-core/issues/378))
80
+
Only properties that are part of [AsyncAPI spec](https://www.asyncapi.com/docs/reference/specification/v3.0.0#schemaObject) are part of the produced AsyncAPI file,
81
+
while the `@Schema` annotation contains some additional properties.
82
+
Contribute in [#378](https://github.com/springwolf/springwolf-core/issues/378), so that all properties are supported in `springwolf-ui`.
The `@AsyncMessage.description` field will always override the `@Schema` description if provided
115
110
:::
116
111
117
112
For a full example, take a look at [ExamplePayloadDto.java in `springwolf-amqp-example`](https://github.com/springwolf/springwolf-core/blob/master/springwolf-examples/springwolf-amqp-example/src/main/java/io/github/springwolf/examples/amqp/dtos/ExamplePayloadDto.java)
118
113
114
+
#### Arrays using `@ArraySchema`
115
+
116
+
When the payload is an array, use `@ArraySchema` annotation instead.
117
+
119
118
#### Primitive, final and external classes
120
119
121
120
When the `@Schema` annotation can't be attached to the payload class (that's `java.lang.String`), the payload can be wrapped in an envelope class. The actual payload is a field within this class (`StringEnvelope`), marked using `@AsyncApiPayload` and documented using the `@Schema` annotation.
0 commit comments