Skip to content
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

How to use custom resolvers in python? #372

Open
karolzlot opened this issue May 17, 2022 · 2 comments
Open

How to use custom resolvers in python? #372

karolzlot opened this issue May 17, 2022 · 2 comments

Comments

@karolzlot
Copy link

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?

@karolzlot
Copy link
Author

karolzlot commented May 17, 2022

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.

@Stranger6667
Copy link
Owner

Thanks for opening this!

Is it possible to use #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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants