When using the following schema
{
"$schema": "http://json-schema.org/schema#",
"definitions":{
"entity": {
"type": "object",
"properties": {
"parent": {"type": ["null","string"]},
"exclude": {"type": "boolean"},
"count": {"type": ["null","integer"]},
"EntityType": {"type": "string"},
"Children": {
"type": "array",
"items": {"$ref":"#/definitions/entity"}
}
}
}
},
"required": ["parent","EntityType","count"]
}
On this provided body of JSON
{
"parent": "null",
"EntityType": "test",
"count": "null",
"Children": [
{
"EntityType": "test",
"count": 3
},
{
"EntityType": "test"
}
],
"Extra": "somevalue"
}
It should be returning that I have provided an invalid Json object, however it does not seem to be doing so.
That said, if I were to have the root node not succeed (by removing one of the required fields) the validation works and says that I haven't provided a required field. Is there a reason that I am not able to validate the json recursively?