I have 3 schemas:
child schema:
{
"title": "child_schema",
"type": "object",
"properties": {
"wkid": {
"type": "number",
"description": " well-known ID"
}
},
"additionalProperties": false,
"required": ["wkid"]
}parent schema: (this parent schema has a $ref pointing to the location where I stored this child schema)
{
"title": "parent_schema",
"type": "object",
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"spatialReference": {
"$ref": ".....(for sure it is correct)"
}
},
"additionalProperties": false
}grandparent schema: (this schema has a $ref key word pointing to the location where I store my parent schema)
{
"title": "grandpa_schema",
"type": "object",
"properties": {
"geometry": {
"type": "object",
"oneOf": [{
"$ref": ".....(for sure it is correct)"
}]
}
},
"additionalProperties": false
}Now comes the problem:
I am trying to use the grandparent schema to validate this JSON data, but I keep on getting a resolution error.
{
"geometry": {
"x": -118.15,
"y": 33.80,
"spatialReference": {
"wkid": 4326
}
}
}conditions: 1. The child schema itself is correct for sure! 2. I can use the parent schema to validate the data below successfully:
{
"x": -118.15,
"y": 33.80,
"spatialReference": {
"wkid": 4326
}
}So why am I getting a exception RefResolutionError?
{
"title": "parent_schema",
"type": "object",
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"spatialReference": {
"title": "child_schema",
"type": "object",
"properties": {
"wkid": {
"type": "number",
}
},
"additionalProperties": false,
"required": ["wkid"]
}
},
"additionalProperties": false
}