Je suis en train de créer springDoc swagger documentation, et j'aimerais représenter des données comme ceci
List<String> elements;
ayant certaines propriétés comme minSize et MaxSize / minLength longueur Max pour les valeurs dans la liste.
J'ai essayé avec ce
@Schema(required = true, minLength = 12,maxLength = 20)
List<String> elements;
et
@Size(min=10,max=20)
List<String> elements;
résultat:
"Products": {
"title": "Products",
"type": "object",
"properties": {
"elements": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
Une idée Pour avoir ce résultat :
"Products": {
"title": "Products",
"type": "object",
"properties": {
"elements": {
"type": "array",
"items": {
"type": "string",
"maxLength": 20,
"minLength": 5
}
}
}
}