Skip to content

Provide a way to disable external fetches. #146

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

Closed
tomprince opened this issue Feb 5, 2014 · 4 comments
Closed

Provide a way to disable external fetches. #146

tomprince opened this issue Feb 5, 2014 · 4 comments

Comments

@tomprince
Copy link

There appears to be no easy way to stop jsonschema from doing blocking I/O when it encounters external references.

@Julian
Copy link
Member

Julian commented Feb 5, 2014

What you might want is RefResolver.store, retrieve your documents asynchronously and then shove them in there before validation.

You also probably would be interested by finishing the API changes needed to make #133 possible.

@tomprince
Copy link
Author

The only helps if I happen to store all the documents I need, but if I happen to miss one, then my code starts blocking.

@tomprince
Copy link
Author

I'd happy if there was an option to either error out, or treat a reference to an unavailable document as a reference to an empty document.

@Julian
Copy link
Member

Julian commented Feb 5, 2014

Ah I see. Well, RefResolver is public API and nothing funky is going on, if you wanted to error out, the easiest way would be to create a ref resolver and then raise a RefResolutionError in the resolve_remote method (or return your empty document as you prefer).

Bit light on docs on how to do that or what constitutes the interface, if it's not obvious enough shout.

@Julian Julian closed this as completed Feb 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants