Closed biafra closed 5 years ago
So "allOf", "anyOf" and "oneOf" has incredible bad error messages. I would love to make them better, but I simply don't know how to.
Any suggestions in the form of a PR is more than welcomed. I don't consider changing the returned errors as a breaking change, so it's fine if the return value is changed.
Another idea might be to add children
or something to JSON::Validator::Error which gives more information for the sub errors.
Also, if you don't make an PR, then just giving an idea about what you expect the output to be might help me in the direction of how to fix it. Just make sure the result also take into consideration if the "anyOf/allOf/oneOf" has children of "anyOf/allOf/oneOf".
Thanks for the answer Jan. I’m new to json schema and didn’t check that the ‘...Of’ could have children. I’m going to see what are my needs and if it’s an acceptable generic solution. Maybe verifying what XML/XSD validators are returning on errors :-)
Paulo
On 17 Jul 2018, at 10:45, Jan Henning Thorsen notifications@github.com wrote:
Also, if you don't make an PR, then just giving an idea about what you expect the output to be might help me in the direction of how to fix it. Just make sure the result also take into consideration if the "anyOf/allOf/oneOf" has children of "anyOf/allOf/oneOf".
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
Closing this in favour of #121.
Usually I get a list of JSON::Validator::Error with each path and message.
Shouldn't it be the same with "allOf" ?
In the following example I get the two errors on the same message and no reference to which property name.
This happens with 2.08
Thank you!