Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Resolve sub schema node only if really needed #51

Merged
merged 1 commit into from
Dec 10, 2017

Conversation

kkalass
Copy link

@kkalass kkalass commented Nov 27, 2017

When JsonSchemaFactory.getSchema is called with anything else than a URL, a specified ID property used to lead to the URI being resolved even if it was not necessary (because there was no ref that cannot be satisfied with the current schema). If the validation code is called to verify a Schema before it is accepted as the "official" schema for a given URI, it will fail because the resolved URI either does not exist yet or contains an older version. Thus I changed the implementation to resolve the sub schema node lazily.

a JsonNode that contains a json schema and was supposed to be validated previously lead to a call to the url - but the url was possibly not yet correctly defined because the schema was not validated... so we need to do the id-based fetching only if actually needed
@stevehu stevehu merged commit a01f5d4 into networknt:master Dec 10, 2017
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants