-
-
Notifications
You must be signed in to change notification settings - Fork 581
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
unhashable definitions in schema #572
Comments
You're providing two arguments to the validator.
…On Wed, Jun 19, 2019, 07:30 Antoine Dechaume ***@***.***> wrote:
Hi,
I've created a schema with a definitions section, but jsonschema 3.0.1
cannot deal with it. Here is a reproducer :
schema.json contains (from here
<http://json-schema.org/latest/json-schema-validation.html#rfc.section.9>
):
{
"type": "array",
"items": { "$ref": "#/definitions/positiveInteger" },
"definitions": {
"positiveInteger": {
"type": "integer",
"exclusiveMinimum": 0
}
}
}
Test code:
import jsonschema
import json
schema = json.load(open('schema.json'))
jsonschema.Draft7Validator({}, schema)
I get this exception:
File "/xxx/lib/python3.6/site-packages/jsonschema/validators.py", line 276, in __init__
_generate_legacy_type_checks(types),
File "/xxx/lib/python3.6/site-packages/jsonschema/validators.py", line 83, in _generate_legacy_type_checks
definitions[typename] = gen_type_check(pytypes)
File "/xxx/lib/python3.6/site-packages/jsonschema/validators.py", line 71, in gen_type_check
pytypes = _utils.flatten(pytypes)
File "/xxx/lib/python3.6/site-packages/jsonschema/_utils.py", line 161, in flatten
types.add(thing)
TypeError: unhashable type: 'dict'
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#572>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AACQQXWRL4BXF3UNACTMGSDP3IRGRANCNFSM4HZJDBTQ>
.
|
I feel stupid, sorry for the noise. |
Julian
added a commit
that referenced
this issue
Jul 11, 2022
69acf529 Merge pull request #572 from json-schema-org/default-reviewers 26a51ca3 Merge pull request #575 from jdesrosiers/add-package-json d0e80a96 Re-add package.json 88d69482 Merge pull request #573 from json-schema-org/handling-nulls-in-instances bd653f34 fixed findings by julian eab34ba6 fix `prefixItems` tests to actually use it (instead of `items`, copy-paste error) 6680a003 fixed typo in `type` declaration: surround with quotes 257f5220 added null-handling tests for unevaluatedItems e3c007dd added null-handling tests for unevaluatedProperties 3d3bdf4e added null-handling tests for properties 54cc5703 added null-handling tests for patternProperties 28419842 added null-handling tests for contains 4d1a916a added null-handling tests for additionalItems 6e47a99a added null-handling tests for prefixItems; fixed indentation on previous commit 761d4b2b added null-handling tests for array-form items 6315a51d added null-handling tests for single-form items 278e5b3b added null-handling tests for additionalProperties bce6b82a Set up default reviewers (the whole test suite team). 9cb7da92 Merge pull request #564 from json-schema-org/sanity-check-terminology 2a316683 Merge pull request #569 from spacether/feat_adds_new_python_consumer fae0017d Removes idea files 8af12a3f Adds python-experimental to the users list c7a0f3e9 Reconcile terminology in the sanity checker with the README git-subtree-dir: json git-subtree-split: 69acf52990b004240839ae19b4bec8fb01d50876
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I've created a schema with a
definitions
section, but jsonschema 3.0.1 cannot deal with it. Here is a reproducer :schema.json contains (from here):
Test code:
I get this exception:
The text was updated successfully, but these errors were encountered: