I’ve got a request object like this:
public record CreateRequest(
@Schema(nullable = true) List<Optional<String>> field1,
@Schema(nullable = true) List<Optional<Struct>> field2) {
public record Struct() {}
}
It generates this openapi.json:
"CreateRequest": {
"properties": {
"field1": {
"items": {
"nullable": true,
"type": "string"
},
"nullable": true,
"type": "array"
},
"field2": {
"items": {
"$ref": "#/components/schemas/Struct"
},
"nullable": true,
"type": "array"
}
},
"required": [],
"type": "object"
},
field1
is generated correctly, with"nullable": true,
underitems
.field2
does not have"nullable": true,
underitems
despite being defined in the same way.
How can I define field2
so that it correctly puts "nullable": true,
under items
?