$ref relative paths - is this standardized? Doesn't work in interactive mode

827 views
Skip to first unread message

Gabriel Underwood

unread,
Jun 28, 2017, 9:35:25 PM6/28/17
to jsonschema - An implementation of JSON Schema for Python
It seems like support for relative paths  doesn't work or at least is not standardized.

says  {"$ref":"definitions.json#/address"} will reference "definitions.json" file in the same directory as the current schema.

jsonschema in interactive mode gives an error

jsonschema.exceptions.RefResolutionError: unknown url type: 'definitions.json'


The only thing that I have been able to get to work is explicit "file:" URIs with fully-qualified file paths, not relative paths. 

Is there a way to support relative resources in schema documents that can be validated by jsonschma and that is likely to be portable across other implementations?    

rlyacht

unread,
Mar 1, 2018, 8:28:52 PM3/1/18
to jsonschema - An implementation of JSON Schema for Python
Same question here.  I want to have a schema with many files that define individual objects. The only way I can make it work is to put them at http://some.thing.here/blah.json and then have


Like OP, I would like to be validate with this:

{"$ref": "./blah.json/definitions/something"}

Is that only kosher in draft5, or should it work?
Reply all
Reply to author
Forward
0 new messages