-
- Notifications
You must be signed in to change notification settings - Fork 603
Closed
Description
Hi,
updated jsonschema to 1.1.0 today and now I'm facing the following problem. Given is a simple schema like this:
{ "type": "object", "$schema": "http://json-schema.org/draft-03/schema", "id": "#", "required": false, "properties": { "record_object": { "type": "object", "id": "record", "properties": { "mimetype": { "type": "string" } } }, "event_object": { "type": "object", "id": "event", "properties": { "actions": { "type": "array", "id": "actions", "items": { "type": "object", "$ref": "#/properties/record_object" } } } } } } Trying to validate the following JSON (or any other) raises an exception:
event = { "event_object": { "actions": [ { "mimetype": "test" } ] }} validate(event, schema) Traceback (most recent call last): File "gsa_schema.py", line 120, in <module> validate(event, s) File "/Users/jan/Documents/code/jira/lib/python2.7/site-packages/jsonschema.py", line 1301, in validate cls(schema, *args, **kwargs).validate(instance) File "/Users/jan/Documents/code/jira/lib/python2.7/site-packages/jsonschema.py", line 226, in validate for error in self.iter_errors(*args, **kwargs): File "/Users/jan/Documents/code/jira/lib/python2.7/site-packages/jsonschema.py", line 219, in iter_errors for error in errors: File "/Users/jan/Documents/code/jira/lib/python2.7/site-packages/jsonschema.py", line 436, in validate_properties for error in self.iter_errors(instance[property], subschema): File "/Users/jan/Documents/code/jira/lib/python2.7/site-packages/jsonschema.py", line 219, in iter_errors for error in errors: File "/Users/jan/Documents/code/jira/lib/python2.7/site-packages/jsonschema.py", line 436, in validate_properties for error in self.iter_errors(instance[property], subschema): File "/Users/jan/Documents/code/jira/lib/python2.7/site-packages/jsonschema.py", line 219, in iter_errors for error in errors: File "/Users/jan/Documents/code/jira/lib/python2.7/site-packages/jsonschema.py", line 268, in validate_items for error in self.iter_errors(item, items): File "/Users/jan/Documents/code/jira/lib/python2.7/site-packages/jsonschema.py", line 219, in iter_errors for error in errors: File "/Users/jan/Documents/code/jira/lib/python2.7/site-packages/jsonschema.py", line 403, in validate_ref with self.resolver.resolving(ref) as resolved: File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/contextlib.py", line 17, in __enter__ File "/Users/jan/Documents/code/jira/lib/python2.7/site-packages/jsonschema.py", line 1026, in resolving document = self.resolve_remote(uri) File "/Users/jan/Documents/code/jira/lib/python2.7/site-packages/jsonschema.py", line 1099, in resolve_remote result = json.loads(urlopen(uri).read().decode("utf-8")) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 126, in urlopen File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 386, in open File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 248, in get_type ValueError: unknown url type: actions In case I do something wrong here please point me to it. Thanks in advance.
Jan
Metadata
Metadata
Assignees
Labels
No labels