I'm using core v3 2.0.2
The following is repro (in Kotlin)
@path("/")
class Api {
@get
fun getter() : Town = Town(listOf())
}
data class Town(
@get:[ ArraySchema( arraySchema = Schema(required = true), schema = Schema(required = true), minItems = 1,uniqueItems = true ) ]
val streets: List
)
@Test
fun tst() {
val api = Reader().read(Api::class.java)
val json = ObjectMapper().setSerializationInclusion(JsonInclude.Include.NON_NULL)
.writerWithDefaultPrettyPrinter().writeValueAsString(api)
json.contains("required")
}
I expect that there should a way of saying that the "streets" property is required
That yields the following json model:
{ "openapi" : "3.0.1", "paths" : { "/" : { "get" : { "operationId" : "getter", "responses" : { "default" : { "description" : "default response", "content" : { "*/*" : { "schema" : { "$ref" : "#/components/schemas/Town" } } } } } } } }, "components" : { "schemas" : { "Town" : { "type" : "object", "properties" : { "streets" : { "minItems" : 1, "uniqueItems" : true, "type" : "array", "items" : { "type" : "string" } } } } } } }