I'm unable to find a solution for the following problem:
Given this input
{
"grandParent": {
"parent1": {
"kids": [{
"name": "David"
}, {
"name": "Josh"
}]
},
"parent2": {
"kids": [{
"name": "Michael"
}]
},
}
}
I'm trying to write a schema that will succeed if at least one of the kids' names (regardless of the parent) is "David" or "Kevin"
Here's the schema I tried:
{
"properties": {
"grandParent": {
"additionalProperties": {
"properties": {
"kids": {
"type": "array",
"contains": {
"properties": {
"name": {
"anyOf": [
{
"type": "string",
"pattern": "David"
},
{
"type": "string",
"pattern": "Kevin"
}
]
}
}
}
}
}
}
}
}
}
For some reason it still errors on the second parent, even though the first one qualifies under that rule.