-
Notifications
You must be signed in to change notification settings - Fork 31
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
Remote references not fetched #17
Comments
OK. It looks like our validation libraries don't do this for us transparently. It's possible (certainly with AJV for draft-04 upwards, not sure about JSV for draft-01 -> -03), but there are a couple of subcases here that we need to think about:
JSON Schema Validator gets around this by submitting your schema and document to a server-side process - that can go ahead and download whatever it wants, so everything's the first subcase. Because jsonschemalint.com is pure client-side, we can't do that without a serious rearchitecting. Anyway - subcase 1 is relatively simple - I'd be happy to accept a PR. Subcase 2 is not. I think we'd have to treat it like subcase 1 and catch the CORS errors, revealing them as validation issues. |
@gberche-orange If you could drop a saved-gist example here for recreation, that would be helpful. |
... scratch that, I'm a dummy. |
#27 doesn't fix this, but it does ensure that this remote reference issue throws an error, rather than silently failing. |
If anyone else would benefit from this, please raise your hands. |
Are there any plans to introduce this feature of external references? Is there an easy way of a local workaround? |
I do not have plans to implement this myself. Please see #17 (comment) for the approaches I'm suggesting. Happy to accept PRs. |
Thanks for sharing this great validator with the community.
I could not make references with remote URI to fetch the remote schema and validate their constraints:
When trying to validate following schema:
against this incorrect document, then no validation error is displays, where it should complain.
As a comparison, it seems to work at http://www.jsonschemavalidator.net/
Might be worth at least failing to validate the schema with remote ref URIs as to avoid wrong expectations by users.
Thanks again,
Guillaume.
The text was updated successfully, but these errors were encountered: