I have 3 schemes:
child schema:
{
"title": "child_schema",
"type": "object",
"properties": {
"wyx":{
"type": "number"
}
},
"additionalProperties": false,
"required": ["wyx"]
}
parent scheme:
{
"title": "parent",
"type": "object",
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"child": {
"$ref": "file:child.json"
}
}
}
grandfather scheme:
{
"type": "object",
"title": "grandpa",
"properties": {
"reason": {
"$ref": "file:parent.json"
}
},
"additionalProperties": false
}
As you can see, gradpa has a ref link for the parent, and the parent has a ref link. All these 3 files are in the same folder. When I use the python validator to validate the grandpa schema, I will continue to get an error called RefResolutionError.
HOWEVER, if I don’t have a grandfather, and I just use the parent scheme and child scheme, everything works! So the problem is that I cannot reference ref (2 levels). But I can have a ref link pointing to a schema (only 1 level).
I wonder why
source
share