-
Notifications
You must be signed in to change notification settings - Fork 355
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
anyOf Warning #441
Comments
Thanks for reporting this. I saw it the day you posted it, and just wanted to let you know that I haven't lost sight of it - I've just been insanely busy with other things (i.e. work that pays the bills), and haven't yet had time to look into the problem in any detail. I will investigate and resolve this, but it might take me another couple of weeks to get to sorry. If someone else feels like sorting it out before then, feel free - pull requests against 6.0.0-dev are welcome :-). |
Definitely understandable, people like you who make time to contribute to projects in addition to work are admirable! Thank you for looking at this. |
I encountered, what I think is, the same error. A simpler example:
and the following JSON data
fails to validate on this with error |
@eldering Your example has nothing to do with the bug reported in this issue, and is actually user error - your schema does doesn't mean what you think it means. Your schema does not define the property The error message you're receiving is correct, as intended, and matches how the spec says this should work. @allentsai - what you have reported is definitely a bug; I'd just lost sight of this one sorry. I will fix it. |
Fixes jsonrainbow#441. The bug in jsonrainbow#441 was caused by refactoring of the optimisation which introduced a type-checking error. Noting the performance impact is negligible for all cases other than large arrays of strings or numbers, and introduces significant cognitive complexity to a project that is extremely short of maintainers, removing it seems like the best course of action. The performance improvement provided by this optimisation was approximately 40%, however it also carried a number of other problematic bugs - if it were to be reintroduced at a later date with those bugs fixed (mainly the skipping of much of the validation logic for optimised items, even in cases where that logic might be necessary), it would not have such a significant impact.
@allentsai This is fixed in #498. I will backport this change for v5.2.8 once the PR is merged. |
Fixes jsonrainbow#441. The bug in jsonrainbow#441 was caused by refactoring of the optimisation which introduced a type-checking error. Noting the performance impact is negligible for all cases other than large arrays of strings or numbers, and introduces significant cognitive complexity to a project that is extremely short of maintainers, removing it seems like the best course of action. The performance improvement provided by this optimisation was approximately 40%, however it also carried a number of other problematic bugs - if it were to be reintroduced at a later date with those bugs fixed (mainly the skipping of much of the validation logic for optimised items, even in cases where that logic might be necessary), it would not have such a significant impact.
Hello, I would first like to thank you all for the hard work you've put into this project, and add the disclaimer that this could very well be user error, but my schema validates with other validators, and previous versions, but I get a warning with v5.2.1.
Stripped down to what is causing the error:
Base schema:
postalList.json:
area.json:
areas.json:
Test Code:
This gives me the follow error repeated twice:
Seems like
anyOf
behavior is being too greedy when evaluating the included schemas. Note that if you swap the order ofpostalList.json
andarea.json
, the warning no longer appears.The text was updated successfully, but these errors were encountered: