I have a nested array that is required and has a minItems of 1, however it does not cause the validation to fail. Unlike a non-nested array which immediately fails the validation. Both the array and nested array are indicated as required, however it does not seem to be working on the nested array.
Here is the schema.json I am using for testing:
{
"type" : "object",
"required": [
"array_1"
],
"properties": {
"array_1": {
"minItems": 1,
"items": {
"required": [
"method_array_1",
"detail_array_1"
],
"properties": {
"method_array_1": {
"type": "string",
"oneOf": [
{
"title": "Email",
"const": "EMAIL"
},
{
"title": "Phone",
"const": "PHONE"
}
],
"title": "Method"
},
"detail_array_1": {
"type": "string",
"title": "Detail"
}
},
"type": "object"
},
"type": "array",
"title": "Array 1 Title"
},
"neseted_array_2": {
"type": "object",
"title": "Nested Array 2",
"required" : [
"array_2"
],
"properties": {
"array_2": {
"minItems": 1,
"items": {
"required": [
"method_array_2",
"detail_array_2"
],
"properties": {
"method_array_2": {
"type": "string",
"oneOf": [
{
"title": "Email",
"const": "EMAIL"
},
{
"title": "Phone",
"const": "PHONE"
}
],
"title": "Method"
},
"detail_array_2": {
"type": "string",
"title": "Detail"
}
},
"type": "object"
},
"type": "array",
"title": "Array 2 Title"
}
}
}
}
}