-
-
Notifications
You must be signed in to change notification settings - Fork 592
misleading erros when failing anyof tests #646
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
Comments
I assume you mean when you're using If you don't though want that behavior, you can use |
You are right I use validate at https://github.com/pycontribs/zuul-lint/blob/master/zuul_lint/__main__.py#L22 but I am going to test more advanced API. Thanks a lot fo the quick reply. That new linter I am writing is very new stuff, is not even 10 hours since I started it. I am also new to jsonschema in general and I do not rule out that my schema may not be well defined. I raised the bug at pycontribs/zuul-lint#2 |
No worries at all!
You're spot on on this one looks like, so if there's a way to improve the
error message for just these kinds of cases sounds great, but yeah it can
get a bit tricky unfortunately... Needs some thought.
…On Sun, Jan 12, 2020, 20:32 Sorin Sbarnea ***@***.***> wrote:
You are right I use validate at
https://github.com/pycontribs/zuul-lint/blob/master/zuul_lint/__main__.py#L22
but I am going to test more advanced API.
Thanks a lot fo the quick reply. That new linter I am writing is very new
stuff, is not even 10 hours since I started it. I am also new to jsonschema
in general and I do not rule out that my schema may not be well defined.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#646>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACQQXXUNPGZ3BEJ6K77EFLQ5N47HANCNFSM4KFZN2QQ>
.
|
Same as #698, since validator of |
I believe the commit I just pushed should make these kinds of cases clearer (by not recursing into them). Feel free to try it out and provide feedback, otherwise a release with it should come out in a day or two. |
@Julian I tested 4.8.0 and I can see the benefits in improved messaging. It broke two tests on my suite but that only helped me upgrade it and fix the tests. Thanks for working on this. |
Nice (other than the breakage :)! Thanks for the feedback and the report. |
19947eaa1 test: unevaluatedProperties not affected by propertyNames 829270631 Check that large integers are multiples of small multipleOf b59543f6e Merge pull request #647 from santhosh-tekuri/ref-start-slash 6e5d45d71 Merge pull request #646 from santhosh-tekuri/vocab-optional 0311dfda0 Merge pull request #651 from santhosh-tekuri/dynamicref-without-anchor 4503eeaf4 test: A $dynamicRef without anchor in fragment behaves identical to $ref 39af4c1ba test: $ref with absolute-path-reference 880c9933b test/vocabulary: ignore unrecognized optional vocabulary fd80307ff Merge pull request #642 from santhosh-tekuri/time-2digit a76ae650d Merge pull request #645 from json-schema-org/gregsdennis/add-vocab-tests-link 0e2b4eefd Merge pull request #643 from 0xSudarshan/main 2b78ccfc4 slight tweaking to wording 8716c4054 add link for vocab test suite to readme c49ba5445 Fix an incorrect $schema identifier. f0e5ce71e Added test for schema-items alongside "ignored" additionalItems 76dae88ab Merge pull request #640 from santhosh-tekuri/refRemote-anchor cb82e237c Merge pull request #641 from json-schema-org/gregsdennis/unevaluated-not-draft-next e4afd233a test/format: hour, min, sec must be two digits 7efd51313 fix unevaluatedProperties/not tests for draft-next e39c6ea6a test/refRemote: anchor within remote ref bf51b32fb Merge pull request #639 from json-schema-org/additionalItems-unevaluatedItems 52160b368 Add a test for 2019's interaction between additional/unevaluatedItems 69a09a339 Fixed tests for annotation collection inside not. e4e1a220b Draft7 if/then/else ref tests need to be wrapped in an allOf. f5bd2f6c3 Merge pull request #632 from json-schema-org/ether/annotations-inside-not 626b433e5 test that annations are collected inside a "not" git-subtree-dir: json git-subtree-split: 19947eaa1289168a49edd21bb7a8aa2098069ae0
Uh oh!
There was an error while loading. Please reload this page.
I discovered that
anyOf
related errors can be very mistleading.Validating snippet above with https://github.com/pycontribs/zuul-lint/blob/master/zuul_lint/zuul-schema.json would fail with a misleading error:
That schema allows multiple value and
nodeset
happens to just one of several. As you can see what user gets is an erros that makes no sense for him.The text was updated successfully, but these errors were encountered: