jsonschema-rs
jsonschema-rs copied to clipboard
How to use custom resolvers in python?
I have JSON schema splitted to more than one file (with refs) in local filesystem.
I use in python: jsonschema_rs.JSONSchema.from_str
and then validate
.
Result:
failed to resolve json-schema:///myschema.schema.json: cannot resolve relative external schema without root schema ID
It isn't surprising because jsonschema_rs
isn't aware where to look for this external reference.
Is it possible to use custom resolver when using jsonschema_rs
from python?
When I specify path in "$id":
in root schema, then I get different error:
relative URL without a base
It seems it can work only with URLs, not paths.
Thanks for opening this!
Is it possible to use https://github.com/Stranger6667/jsonschema-rs/pull/341 when using jsonschema_rs from python?
Not at the moment, but it should be possible to implement on the bindings level. However, I am reworking this part now, so the interface might change, but it should not be much problematic to adjust it in the future.
When I specify path in "$id": in root schema, then I get different error: It seems it can work only with URLs, not paths.
Strange, I got to check why it is happening.