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
"TypeError: argument of type 'bool' is not iterable" when unevaluatedProperties present but instance is boolean #867
Comments
Looks like the same type of issue as commit 12a92ea. 'additionalProperties' has the object type check, but 'unevaluatedProperties' does not. Comparing 'additionalItems' and 'unevaluatedItems', the same issue exists there too. |
Thanks for the report!
A PR would be very welcome -- the first step would be adding tests to the official test suite here: https://github.com/json-schema-org/JSON-Schema-Test-Suite/blob/master/tests/draft2020-12/unevaluatedProperties.json which is what is run as part of this library's test suite to essentially "force" its implementation to be correct. Could you perhaps add one there which I can merge, and then it should be reasonably easy to add some lines here that fix the problem? Let me know if you need further help. |
Thanks Julian, I'll definitely take a run at that and let you know once I have a PR there on the test repo. I cloned this repo last night too after robherring's helpful hints but I had all kinds of trouble getting the tests to run using tox. I was getting some cryptic ungooglable error about wheels that nobody else in the world seems to be having 😆. Is there a quick-and-dirty way you can point me to for running the jsonschema repo's test suite quickly as part of a development workflow that doesn't involve the whole tox rigmarole? |
Great!
|
This was fixed in #949. |
Here's a minimum reproducer with jsonschema==4.1.2:
I get the following exception:
I wonder if the checks on line 286 and 293 should also consider the type of the instance before acting on it? I would expect the above schema to pass, but even if it shouldn't, this isn't a great error for it to be raising. I'm very happy to submit a PR if someone can nudge me in the right direction for how to approach a fix.
Just to preempt a little bit, I'm aware the example can be rewritten as a oneOf/anyOf, but that's neither here nor there; this is intended as a minimum reproducer of an issue I found rather than a demonstration of what I'm actually doing in practice.
The text was updated successfully, but these errors were encountered: