Skip to content

Commit cffc085

Browse files
committed
docs: update for 0.18.0 release
1 parent 517db8b commit cffc085

File tree

6 files changed

+59
-38
lines changed

6 files changed

+59
-38
lines changed

docs/configuration/configuration.mdx

Lines changed: 28 additions & 27 deletions
Large diffs are not rendered by default.

docs/configuration/documenting-messages.mdx

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ The default Jackson `ModelResolver` supports schema definitions via `@Schema` to
7272

7373
### Using `@Schema`
7474

75-
The `@Schema` annotation allows to set many properties like `description`, `example`, `requiredMode` to document payloads.
75+
The `@Schema` annotation allows to set many properties like `description`, `example`, `requiredMode`, `minimum` to document payloads.
7676

77-
All properties are part of the produced AsyncApi file. However, not all are displayed in `springwolf-ui`. The ones listed above are included.
77+
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))
7878

79-
### Usage
79+
#### Usage
8080

8181
Add the following dependency:
8282

@@ -114,6 +114,26 @@ The `@AsyncMessage.description` field will always override the `@Schema` descrip
114114

115115
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/stavshamir/springwolf/example/amqp/dtos/ExamplePayloadDto.java)
116116

117+
#### Primitive, final and external classes
118+
119+
When the `@Schema` annotation cannot be attached to the payload class (i.e. `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.
120+
121+
```java
122+
@AsyncListener( operation = @AsyncOperation( channelName = TOPIC,
123+
payloadType = StringEnvelope.class) // <- envelope class
124+
)
125+
public void receiveStringPayload(String stringPayload) { // <- The original class is used here
126+
// ...
127+
}
128+
129+
@Data
130+
static class StringEnvelope {
131+
@AsyncApiPayload // <- The annotation marker
132+
@Schema(description = "Payload description using @Schema annotation and @AsyncApiPayload within envelope class")
133+
private final String payload;
134+
}
135+
```
136+
117137
### `json-schema`
118138

119139
The [`springwolf-add-ons/springwolf-json-schema`](https://github.com/springwolf/springwolf-core/tree/master/springwolf-add-ons/springwolf-json-schema) adds the [json-schema](https://json-schema.org) schema to the AsyncApi document.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
dependencies {
2-
implementation 'io.swagger.core.v3:swagger-core:2.2.10'
2+
implementation 'io.swagger.core.v3:swagger-core:2.2.20'
33
}

docs/configuration/snippets/_schema_maven.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
<dependency>
33
<groupId>io.swagger.core.v3</groupId>
44
<artifactId>swagger-core</artifactId>
5-
<version>2.2.10</version>
5+
<version>2.2.20</version>
66
</dependency>
77
</dependencies>
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
dependencies {
22
// Provides the documentation API
3-
implementation 'io.github.springwolf:springwolf-kafka:0.17.0'
3+
implementation 'io.github.springwolf:springwolf-kafka:0.18.0'
44

55
// Provides the UI - optional (recommended)
6-
runtimeOnly 'io.github.springwolf:springwolf-ui:0.17.0'
7-
}
6+
runtimeOnly 'io.github.springwolf:springwolf-ui:0.18.0'
7+
}

docs/snippets/_springwolf_maven.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
<dependency>
44
<groupId>io.github.springwolf</groupId>
55
<artifactId>springwolf-kafka</artifactId>
6-
<version>0.17.0</version>
6+
<version>0.18.0</version>
77
</dependency>
88
<!-- Provides the UI - optional (recommended) -->
99
<dependency>
1010
<groupId>io.github.springwolf</groupId>
1111
<artifactId>springwolf-ui</artifactId>
12-
<version>0.17.0</version>
12+
<version>0.18.0</version>
1313
</dependency>
14-
</dependencies>
14+
</dependencies>

0 commit comments

Comments
 (0)