diff options
Diffstat (limited to 'tests/draft6')
-rw-r--r-- | tests/draft6/dependencies.json | 38 | ||||
-rw-r--r-- | tests/draft6/ref.json | 85 | ||||
-rw-r--r-- | tests/draft6/uniqueItems.json | 5 |
3 files changed, 128 insertions, 0 deletions
diff --git a/tests/draft6/dependencies.json b/tests/draft6/dependencies.json index a5e5428..c0bd809 100644 --- a/tests/draft6/dependencies.json +++ b/tests/draft6/dependencies.json @@ -244,5 +244,43 @@ "valid": false } ] + }, + { + "description": "dependent subschema incompatible with root", + "schema": { + "properties": { + "foo": {} + }, + "dependencies": { + "foo": { + "properties": { + "bar": {} + }, + "additionalProperties": false + } + } + }, + "tests": [ + { + "description": "matches root", + "data": {"foo": 1}, + "valid": false + }, + { + "description": "matches dependency", + "data": {"bar": 1}, + "valid": true + }, + { + "description": "matches both", + "data": {"foo": 1, "bar": 2}, + "valid": false + }, + { + "description": "no dependency", + "data": {"baz": 1}, + "valid": true + } + ] } ] diff --git a/tests/draft6/ref.json b/tests/draft6/ref.json index 8a36593..8a8908a 100644 --- a/tests/draft6/ref.json +++ b/tests/draft6/ref.json @@ -813,5 +813,90 @@ "valid": false } ] + }, + { + "description": "$id with file URI still resolves pointers - *nix", + "schema": { + "$id": "file:///folder/file.json", + "definitions": { + "foo": { + "type": "number" + } + }, + "allOf": [ + { + "$ref": "#/definitions/foo" + } + ] + }, + "tests": [ + { + "description": "number is valid", + "data": 1, + "valid": true + }, + { + "description": "non-number is invalid", + "data": "a", + "valid": false + } + ] + }, + { + "description": "$id with file URI still resolves pointers - windows", + "schema": { + "$id": "file:///c:/folder/file.json", + "definitions": { + "foo": { + "type": "number" + } + }, + "allOf": [ + { + "$ref": "#/definitions/foo" + } + ] + }, + "tests": [ + { + "description": "number is valid", + "data": 1, + "valid": true + }, + { + "description": "non-number is invalid", + "data": "a", + "valid": false + } + ] + }, + { + "description": "empty tokens in $ref json-pointer", + "schema": { + "definitions": { + "": { + "definitions": { + "": { "type": "number" } + } + } + }, + "allOf": [ + { + "$ref": "#/definitions//definitions/" + } + ] + }, + "tests": [ + { + "description": "number is valid", + "data": 1, + "valid": true + }, + { + "description": "non-number is invalid", + "data": "a", + "valid": false + } + ] } ] diff --git a/tests/draft6/uniqueItems.json b/tests/draft6/uniqueItems.json index 2ccf666..d2730c6 100644 --- a/tests/draft6/uniqueItems.json +++ b/tests/draft6/uniqueItems.json @@ -54,6 +54,11 @@ "valid": false }, { + "description": "property order of array of objects is ignored", + "data": [{"foo": "bar", "bar": "foo"}, {"bar": "foo", "foo": "bar"}], + "valid": false + }, + { "description": "unique array of nested objects is valid", "data": [ {"foo": {"bar" : {"baz" : true}}}, |