Open gberche-orange opened 7 years ago
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.
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 https://github.com/nickcmaynard/jsonschemalint/issues/17#issuecomment-276349977 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.