-
-
Notifications
You must be signed in to change notification settings - Fork 610
Closed
Description
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):
{
"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'
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels