-
-
Notifications
You must be signed in to change notification settings - Fork 15
Relative file path references not supported? #70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hey! Relative You're aware as well hopefully that even if they did exist, that relative reference would likely be interpreted relative to the working directory not the file location where the URI is located itself. It's super fragile. The above being said though, if I understand your question, you could simply transform the path in your |
Hi Julian, I wasn't aware that relative file URIs aren't spec compliant! I have refactored our schema to eliminate them and use a base path to locate them. Thanks for your reply! I think we can close this issue. |
Glad to hear it thanks for the follow up. |
Hi,
I've inherited some code using the old RefResolver (4.17) version of jsonschema, I'm working on updating it to use the new referencing library.
Our JSON schemas contain references like this:
I've constructed a Registry object with a retrieve function, which is passed to the validator.
(For context,
schema_base_path
is the directory path to the primary schema, from which relative references are resolved.)However, referencing appears to ignore the relative file path
..
. In the above example, retrieve_schema receives the following URI:file:///networks/network_asset.json
. In testing, I discovered thatfile:./networks/network_asset.json
andfile:networks/network_asset.json
resolve to an identical URI. This prevents me from resolving the relative path to the reference...I narrowed it down to the lookup function in
referencing/_core.py
, line 581:Does referencing support relative file path references? If so, how can I configure that?
The text was updated successfully, but these errors were encountered: