Если я определю @Schema
для карты, сгенерированная спецификация OpenAPI c будет иметь дубликаты.
Например:
@Schema(description = "Contents of the bag",
example="{\"Apple\":\"Braeburn\",\"Pear\":\"Conference\"\"Melon\":\"Honeydew\"}",
allowableValues= {
"Apple", "Pear", "Melon", "Plum"
})
public final Map<String, Object> properties;
Это создает:
"properties" : {
"otherProp" : {
"type" : "string",
"description" : "...",
},
"properties" : {
"type" : "object",
"additionalProperties" : {
"type" : "object",
"description" : "Contents of the bag",
"example" : "{\"Apple\":\"Braeburn\",\"Pear\":\"Conference\"\"Melon\":\"Honeydew\"}",
"enum" : [ "Apple", "Pear", "Melon", "Plum" ]
},
"description" : "Contents of the bag",
"example" : "{\"Apple\":\"Braeburn\",\"Pear\":\"Conference\"\"Melon\":\"Honeydew\"}",
"enum" : [ "Apple", "Pear", "Melon", "Plum" ]
}
}
description
, example
и enum
дублированы.
Есть ли способ документировать ключ и значение отдельно?