-
Notifications
You must be signed in to change notification settings - Fork 325
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
OneOf validation gives unnecessary errors #535
Comments
I think I have seen the same issue recently. Would it be possible that we do see the superfluous "is missing but it is required" not just in an OneOf, but also an AnyOf scenario (with at least one value required, but more than one valid)? Looking forward to seeing your PR submitted... |
Sure, I would be happy to submit the PR, but I don't have the permissions to push my changes to a branch. Can you help with that? |
@RenegadeWizard , you can perfectly create a PR from your own fork (and typically also, a dedicated branch in this fork) of the project: see https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork |
Great, thanks for your help, I submitted a PR: #537 |
Hello @RenegadeWizard, what is your current progress regarding the addition of an "AnyOf" fix to your PR that we discussed here: #537 (comment)? Even though there could already be at least one subschema passing validation without "required" property issues, this fact so far is not taken into account, and subsequent "required" validation issues for other subschemas are still reported (even though they should not matter as we already have at least one valid subschema)... In case you don't have a fix in preparation already, I'd try myself to derive one throughout the rest of this week. Thanks a million for a short update on your status! 👍 |
…Validator, too (in addition to OneOfValidator)
As I haven't heard back from @RenegadeWizard, I have moved forward and created a proposed fix myself: #559 😄 (Please note that in the current state of master, some tests fail, but this is NOT due to this my PR...) |
@AndreasALoew I have rerun the test on the master branch and all tests are passed. Could you please point out which test case failed for you? Thanks. |
|
…, too (#559) (in addition to OneOfValidator)
Sorry. I missed the confirmation from @RenegadeWizard. I tested this morning and merged. Thanks a lot for your help. |
Many thanks as well to you, @stevehu , for now doing this super-fast merge! 👍 May I ask you for when the next offcial release (i.e. 1.0.70 ?) will be scheduled? Will this be before June 3rd? Thanks again for your kind help! 😄 |
I have released 1.0.70 minutes ago. Please let me know if you encounter any issues. Thanks. |
Will do, but only tomorrow... Thanks again for your great responsiveness! 👍 👍 👍 |
Let's say we have a schema like this one:
So we have one
oneOf
property that requires eitherproperty1
orproperty2
.This json is incorrect and the validator should return error that the value of
property1
is incorrect, but in addition to that it returns an error that property2 is required and missing:It's not correct, because
property1
is already present, just incorrect. So the error that property2 is required is unnecessary/incorrect.I have a fix for that, just have to submit a PR
The text was updated successfully, but these errors were encountered: