{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"sources": {
"title": "Sources",
"type": "array",
"x-jsf-presentation": {
"inputType": "group-array",
"min": 0,
"max": 61
},
"items": {
"type": "object",
"properties": {
"index": {
"type": "integer",
"title": "index",
"minimum": 1,
"maximum": 62,
"x-jsf-presentation": {
"inputType": "number",
"min": 1,
"max": 62
}
},
"device": {
"type": "integer",
"title": "Device",
"minimum": 1,
"maximum": 62,
"x-jsf-presentation": {
"inputType": "number",
"default": 1,
"min": 1,
"max": 62
}
}
},
"required": [
"device",
"index"
],
"additionalProperties": false
},
"minItems": 0,
"maxItems": 61,
"uniqueItems": true
}
},
"required": [
"sources"
],
"additionalProperties": false
}
I added a small vue example showing my issue, I would appreciate every bit of help.
Description:
I’m using remotess json-schema-form in my vue project. The schema I created has a parent array property ("inputType": "group-array") which is required, but the array itself can be empty (minItems: 0).
Look here:
Problem:
When I validate the following json: {"sources":[]} it always says {"sources":"Required field"} and the problem is only gone, when I remove the "required": [
"sources"
]
I added a small vue example showing my issue, I would appreciate every bit of help.
bug_empty_required_json.zip