The following is my schema structure:
{
"type": "object",
"title": "Review",
"required": [
"reviews"
],
"properties": {
"reviews": {
"type": "array",
"items": {
"type": "object",
"properties": {
"user": {
"title": "User",
"type": "string"
},
"rating": {
"title": "Rating",
"type": "number",
"minimum": 0,
"maximum": 5
},
"comment": {
"title": "Comment",
"type": "string",
"maxLength": 100
}
},
"required": [
"user",
"rating",
"comment"
]
}
}
}
}
This schema represents an array of reviews where users can add or remove comments.
I am looking for a way to always render 2 items from the array by default. How should I achieve this?
I attempted using maxItems
and minItems
, but they do not seem to work as expected in rendering the items.