-
Notifications
You must be signed in to change notification settings - Fork 325
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
stackOverflowError loading schema file #96
Comments
Version 0.1.13 |
@mpmiller37 Thanks a lot for bringing it up. I am fixing it. |
Hi, any guesstimate concerning a possible time frame for this fix? Thx |
After digging into the codebase, I think we might need to fix the issue by addressing this #63 The stack overflow is caused by self-referenced schema and it only happens when you have the wrong schema deployed. In most of our use cases, we package the schema within the application so it is a controlled risk at the moment unless someone builds an application that accepts schema from the Internet. |
Hi Steve, in your last comment, "caused by self-referenced schema" are you talking about schema line 13 "items": {"$ref": "#/definitions/def_node"}? |
this problem seems to happen with any schema that has recursive self reference in the schema definition. Unless some other work happens at the same time, I don't see #63 solving this problem? |
@jarrod180 You are right. The recursive self-reference issue is not easy to fix and I have too many high priority tasks in my plate now. I just marked the issue with |
@mpmiller37 The recursive self-reference issue is fixed by @davidvisiedo in #180 I have merged the PR into the master branch and the release is pending. I am wondering if you could help to retest your use case to confirm the fix works. You can wait until the next release is out or build the jar locally from the master branch. Thanks. |
Getting schema using the api causes 2 warnings and a StackOverflowError, pretty simple example below:
`public class JsonTester {
}`
Output:
Validating:
https://scap.nist.gov/schema/nvd/feed/0.1/nvd_cve_feed_json_0.1_beta.schema
file://C:/temp/feeds/json/cve/1.0/nvdcve-1.0-recent.json
[main] WARN com.networknt.schema.JsonMetaSchema - Unknown keyword copyright - you should define your own Meta Schema. If the keyword is irrelevant for validation, just use a NonValidationKeyword
[main] WARN com.networknt.schema.JsonMetaSchema - Could not load validator $ref
error: java.lang.StackOverflowError
I notice that if I use the online validator at: https://www.jsonschemavalidator.net/
It shows No Errors when I paste the schema and json into the specified textboxes.
Any help would be appreciated.
The text was updated successfully, but these errors were encountered: