-
Notifications
You must be signed in to change notification settings - Fork 358
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
Add only not unique items into result errors #220
Conversation
First off thank you for your contribution. I can see how at first glance it's not intuitive to see
One thing I do realize now that I'm looking into this is that there isn't really any feedback given on which array items cause the check to fail. It just says, this check on this array fails, good luck with that. It might be nice to be a bit more verbose and also indicate which array items cause the check to fail and somehow include that information, but I'm not convinced that this specific way is the right way to go. |
Hi @johandorland! Thanks for your detailed answer! I think you're right that we should not break the contract of Values(). I missed it in my commit.
|
Looking forward to this change! Anything that makes finding the problem easier is a great addition here. |
@austinov That seems like a better solution indeed. You might even want to go a bit further
|
@johandorland, i fixed the commit as i understood you )).
will be
|
Thank you for taking the time to put together this PR, it's greatly appreciated. |
@johandorland thank you too! |
If you try to validate the following json:
with the schema:
then all unique and not unique items will be added to the result errors.
For example:
Although, in my opinion is more logical to add only non-unique elements into result errors.
This commit fixes it and the result will be: