ฉันพยายามที่จะสร้าง springDoc งฟอรืมเอกสารคู่มือ,และฉันอยากจะเป็นตัวแทนของข้อมูลแบบนี้
List<String> elements;
มีบางคุณสมบัติเหมือน minSize และ MaxSize/ความยาวแม็กซ์ความยาวสำหรับค่าอยู่ในรายการ
ฉันพยายามกับเรื่องนี้
@Schema(required = true, minLength = 12,maxLength = 20)
List<String> elements;
แล้ว
@Size(min=10,max=20)
List<String> elements;
ผลลัพธ์:
"Products": {
"title": "Products",
"type": "object",
"properties": {
"elements": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
รู้ไหมว่าจะมีผล:
"Products": {
"title": "Products",
"type": "object",
"properties": {
"elements": {
"type": "array",
"items": {
"type": "string",
"maxLength": 20,
"minLength": 5
}
}
}
}