Skip to content

Commit 28bc2a4

Browse files
committed
chore: Update documentation on Schema annotation
1 parent 1baf1ea commit 28bc2a4

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

docs/documenting-schemas.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The default Jackson `ModelResolver` supports schema definitions via `@Schema` to
1717

1818
## Using `@Schema`
1919

20-
The `@Schema` annotation allows to set many properties like `description`, `example`, `required` to document payloads.
20+
The `@Schema` annotation allows to set many properties like `description`, `example`, `requiredMode` to document payloads.
2121

2222
All properties are part of the produced AsyncApi file. However, not all of them are displayed in springwolf-ui. The ones listed above are included.
2323

@@ -37,10 +37,11 @@ Add the following dependency:
3737
Then, add the `@Schema` annotation to the payload class:
3838
```java
3939
import io.swagger.v3.oas.annotations.media.Schema;
40+
import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.REQUIRED;
4041

4142
@Schema(description = "Example payload model")
4243
public class ExamplePayloadDto {
43-
@Schema(description = "Some string field", example = "some string value", required = true)
44+
@Schema(description = "Some string field", example = "some string value", requiredMode = REQUIRED)
4445
private String someString;
4546

4647
public String getSomeString() {

docs/snippets/_schema_groovy.md

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.0'
2+
implementation 'io.swagger.core.v3:swagger-core:2.2.10'
33
}

docs/snippets/_schema_maven.md

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.0</version>
5+
<version>2.2.10</version>
66
</dependency>
77
</dependencies>

0 commit comments

Comments
 (0)