-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
GenericSchemaDocument does not report errors #1841
Comments
The constructor currently ignore any unsupported schema. |
I checked #1393 have CI error now. |
@miloyip I have created a branch in my fork
It works in a similar way to the validator errors, and creates a very similar error structure which you can access using I have encountered one problem, and that is with check for Example: The alternative is not to check regexes, which is what your code does today. This is bad, as this has the result of not detecting validation errors where the JSON property value does not match the regex, so is a false positive. Please advise how you would like to proceed. |
@miloyip Please note that I have further changes, not yet in a branch, that add detection of |
There is currently no concept in the GenericSchemaDocument of detecting errors in the JSON document it is 'compiling'. It can't return an error, because all the processing happens in the constructor. But it could set a private member and provide a getter method to return an error code. The class is obviously written to be tolerant but I think some error reporting is needed. In our usage, we validate a JSON schema against the Draft-04 metaschema, before letting it be used to validate instance documents, but that doesn't catch things like failure to resolve a $ref. @miloyip your thoughts please. I am happy to create a PR.
The text was updated successfully, but these errors were encountered: