-
Notifications
You must be signed in to change notification settings - Fork 144
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
[DRAFT] Provide richer error info for logical combination schemas #67
Conversation
…as (allOf, anyOf, oneOf)
I suspect it would be a good idea to align |
I think the draft08 On the other hand, the |
Another question to answer before I really get stuck into this is whether all the different 'draft08' validation output levels ( |
You are asking good questions here. I haven't looked at draf8 at all. I can't be of much help in this discussion for the moment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your changes look good to me.
And if it improves error reporting then it is a good thing.
Thanks for the positive response, @pboettch. I've been diving into the definition of Output Formatting in the latest JSON Schema draft, and it makes a lot of sense. I think we can end up with an implementation that is able to produce the final validation output in any of the four forms. There will need to be some structural changes to the code that will ensure the output includes all failures in the case of multiple failures and on the other hand, allow "short circuit" validation for performance in all cases where that's possible. Short circuiting has two forms:
I note that the statement in json-schema-org/json-schema-spec#779 (comment) reflects how I was thinking of tweaking the implementation of (FWIW, I think most of the above will bring much better error reporting without the need to adopt the other changes proposed in draft08 yet.) |
Is there still work to include something like this? |
I haven't checked the newer drafts/standards but back then I saw that error-reporting was defined as well. To make it clearer independently of the chosen programming language. |
I haven't had time to investigate the progress of the spec or bring this to a conclusion, sorry. It's still a good idea! 💡 |
Is there any updates on this? This would be appreciated |
Currently not, but if you have time to help, this would equally be appreciated. |
Follow-up to #52.
If a schema includes an "allOf", "anyOf" or "oneOf" near to the root, error messages are almost useless unless they go beyond "one of the subschemas is required to validate" and identify what the failures in each of the subschemas were. Gathering this error info would allow heuristics to be applied to identify the 'best match' (see json-schema-org/json-schema-spec#632), or most nearly matching subschema.
This is a DRAFT pull request to gain feedback as to whether such an approach would fit into this library.