For example, if I have a json object like this:
{
"people":[
{"id":"a","name":"a","gender":"m"},
{"id":"b","name":"b","gender":"f"},
{"id":"c","name":"c","gender":"f"},
{"id":"d","name":"d","gender":"m"}
],
"over21":[
"a",
"c"
]
}
and I would like to validate that every name in the over21 array exist in the people array. Using $ref didn't solve the problem because it validates its type, but not its existence elsewhere.
example of a json that should fail validation (since "e" does not exist):
{
"people":[
{"id":"a","name":"a","gender":"m"},
{"id":"b","name":"b","gender":"f"},
{"id":"c","name":"c","gender":"f"},
{"id":"d","name":"d","gender":"m"}
],
"over21":[
"a",
"e"
]
}