After replaced the option required at @Schema annotation by requiredMode on #4286, it seems the issue #3438 is shown again.
According to the comments of ArraySchema annotation, ArraySchema.schema defines the model of the items within the array, while ArraySchema.arraySchema defines the model for the model of the array itself.
Example
In this example, I provide an almost same example at the #3438.
For the below DTO class:
public class Person {
@ArraySchema(
arraySchema = @Schema(requiredMode = RequiredMode.REQUIRED)
)
private List<String> addresses;
}
I expect the generated special to have (but it's not):
{
"Person": {
"required": [
"addresses"
]
}
}
And I need to work around this by:
public class Person {
@ArraySchema(
arraySchema = @Schema(description = "The person"),
schema = @Schema(requiredMode = RequiredMode.REQUIRED)
)
private List<String> addresses;
}
After replaced the option
requiredat@Schemaannotation byrequiredModeon #4286, it seems the issue #3438 is shown again.Example
In this example, I provide an almost same example at the #3438.
For the below DTO class:
I expect the generated special to have (but it's not):
{ "Person": { "required": [ "addresses" ] } }And I need to work around this by: