Skip to content

Fix issue #180: Prevents recursive parsing of $ref references. #181

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

Merged
merged 1 commit into from
Aug 7, 2019
Merged

Fix issue #180: Prevents recursive parsing of $ref references. #181

merged 1 commit into from
Aug 7, 2019

Conversation

davidvisiedo
Copy link
Contributor

Prevents recursive parsing of json schema when conditions like told in json-schema specification, point 8.3.1:

https://json-schema.org/latest/json-schema-core.html#rfc.section.8.3.1

"A schema MUST NOT be run into an infinite loop against a schema. For example, if two schemas "#alice" and "#bob" both have an "allOf" property that refers to the other, a naive validator might get stuck in an infinite recursive loop trying to validate the instance. Schemas SHOULD NOT make use of infinite recursive nesting like this; the behavior is undefined. "

…n json-schema specification, point 8.3.1:

https://json-schema.org/latest/json-schema-core.html#rfc.section.8.3.1

"A schema MUST NOT be run into an infinite loop against a schema. For example, if two schemas "#alice" and "#bob" both have an "allOf" property that refers to the other, a naive validator might get stuck in an infinite recursive loop trying to validate the instance. Schemas SHOULD NOT make use of infinite recursive nesting like this; the behavior is undefined. "
Copy link
Contributor

@BalloonWen BalloonWen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added a map to record refParsingInProgress to avoid duplicate refs
looks good to me.

@stevehu stevehu merged commit 9ead708 into networknt:master Aug 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants