Closed otto-ifak closed 7 months ago
There is currently no test for this PR, maybe you could give me a hint where to put it? Also, I am not sure if this change has a performance impact.
Thanks for the PR! I haven't looked carefully at it yet, but as for:
There is currently no test for this PR, maybe you could give me a hint where to put it?
The first step here would be a PR to the official JSON Schema test suite, specifically in the enum.json
test file for each draft.
Once that's merged, we can bring the update in here, and then should be able to consider the PR.
Can you have a look there and let me know if you run into any trouble?
Thanks for your reply. I have created the PR:
https://github.com/json-schema-org/JSON-Schema-Test-Suite/pull/712
I'm not sure how implicit casting works in python, but is it possible that [0]
and [False]
are the same thing in python?
(I get that they're not the same in JSON.)
@gregsdennis yes, that is right:
In Python 0 == False
holds, so that [0] == [False]
holds and so does [0] in [[False]]
hold, which is the cause for this issue.
Thanks again @otto-ifak!
@Julian you're welcome - thank you for this great library :smile:
The following schema accepts the instance although it should be rejected:
I guess, this is caused by the following line: https://github.com/python-jsonschema/jsonschema/blob/256dadd3539861ae696c03805923eb4097b871f9/jsonschema/_keywords.py#L271
(
[0] in [[False]]
is true, so[0] not in [[False]]
is false)📚 Documentation preview 📚: https://python-jsonschema--1208.org.readthedocs.build/en/1208/