question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

JSON schema validation fails when there is no internet connection

See original GitHub issue

I 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:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
Relequestualcommented, Sep 6, 2021

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!

0reactions
erosbcommented, Sep 2, 2021

I would expect when a JSON Schema is provided, it’s validated against the appropriate meta-schema before being used.

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).

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found