How to use relative path for $ref in Json Schema

713 views
Skip to first unread message

Jiajie Duan

unread,
Jul 24, 2014, 11:50:58 AM7/24/14
to json-...@googlegroups.com

Say I have a json schema called child.json.

"$ref": "file:child.json" will work

"$ref": "file:./child.json" will work

That is the only two relative path worked for me. I am using the python validator:http://sacharya.com/validating-json-using-python-jsonschema/

The issue I have is: if i have 3 schema: grandpa.json, parent.json, and child.json; grandpa is referring to parent using "$ref": "file:parent.json and parent is referring to child using "$ref": "file:child.json. Then the above relative path does not work no more

Geraint

unread,
Jul 24, 2014, 12:15:38 PM7/24/14
to json-...@googlegroups.com
This seems to be a duplicate of your other thread.

If individual "$ref"s work, but having three of them causes problems, then I suggest you raise an issue on the project directly.

All the best,
Geraint
Reply all
Reply to author
Forward
0 new messages