JSON schema validation fails when there is no internet connection
See original GitHub issueI am getting below error while trying to validate a JSON against a schema
java.io.UncheckedIOException: java.net.UnknownHostException: json-schema.org
at org.everit.json.schema.loader.internal.DefaultSchemaClient.get(DefaultSchemaClient.java:27)
The schema has a ref to “$ref”: “http://json-schema.org/draft-07/schema#” and this fails at DefaultSchemaClient.java:27 when there is no internet connection.
Is there a way to get around this issue ?
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
schema not works when no internet connection - Stack Overflow
First, you are using the schema which is a public URL. It is obvious trying to download from the internet. If you use...
Read more >A Vocabulary for Structural Validation of JSON - JSON Schema
If the instance is a number, then the instance is valid only if it has a value strictly greater than (not equal to)...
Read more >draft-handrews-json-schema-validation-02 - IETF Datatracker
Internet -Draft JSON Schema Validation September 2019 6.3.2. minLength The value of this keyword MUST be a non-negative integer. A string instance is...
Read more >Improved Error Messages for Schema Validation in MongoDB ...
The most popular way to express the validation rules is JSON Schema. It ... Let's make sure there are no duplicate elements in...
Read more >JSON Schema Validator - MuleSoft Documentation
You can match against schemas that exist in a local file or in an external URI. If the validation fails, an exception is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In which case, fair enough! I’d expect this to be done in addition to the meta-schema evaluation should it fail. I would guess using the meta-schema might be a quick first pass.
Having said that, I’m not sure that would be beneficial. I’m not sure my coffee has kicked in yet!
The library throws informative exceptions in case the schema turns out to be un-processable. This is done programmatically using an internal API and the meta-schema is not used for this purpose (hence, the library doesn’t expect to be able to find anything at the dialect URI).