-
-
Notifications
You must be signed in to change notification settings - Fork 571
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
Incorrect SchemaError for enum schema with unique elements #529
Comments
I also just want to say thanks for the I stumbled over this when a build failed for my |
Woohoo, thanks for writing the hypothesis thing, been on my list for awhile but never gotten to it (oddly got to it for protobuf first). That first one does look like a bug, though The second one also looks like a bug but not here :), because all
Thank you! That's very very good to hear :) particularly about the error messages. There's still lots to do to make them even better I suspect, but yeah glad they helped. |
OK, have pushed a local fix for the metaschema bugs here... Gonna have to set aside some time to start moving tests upstream to help us move it into the spec repo too. |
Hee hee I also just realized that the second bug is likely impossible to fix for arbitrary types, so will need to think about what to do about that. |
I just checked this, and it's fixed as of |
20fb14bde Merge pull request #537 from jimmylewis/removeInvalidTest d07162bcf Remove invalid draft6 test using draft7 constructs 26f74befc Add org badges 6e87b5bdb Merge pull request #529 from yakimun/remove-non-canonical-uris c5ba7b28f Replace non-canonical URIs with canonical ones 8d96d15fc Merge pull request #527 from johnnoone/patch-2 b7f657f77 Update vocabulary.json e82bfdfa5 s/future/next/ in schema reference git-subtree-dir: json git-subtree-split: 20fb14bde8f3c45a8933cd13283557c1b1fdf5b5
I mentioned this briefly on json-schema-org/json-schema-spec#717 (comment) but just for archaeological purposes, this change was just partially "backed out" for drafts 3 and 4 where indeed the original behavior (MUST) was correct, those drafts contain stronger language. It's definitely correct on newer ones though (so thanks again for filing it!) |
@Julian thanks for the "for archeological purposes", rest assured it's worth adding as people still run into this strange mismatch years later 😄 |
There are IMO two bugs here:
JSON values are being tested for equality using Python object semantics, rather than comparing them as JSON (e.g. via a canonical encoding).
The json-schema specification says
Validation therefore ought to allow schema authors to use empty or non-unique arrays, because the RFC 2119 definition of
SHOULD
explicitly permits ignoring such clauses after considering the circumstances.The text was updated successfully, but these errors were encountered: