diff options
author | Julian Berman <Julian@GrayVines.com> | 2023-03-14 17:22:00 -0400 |
---|---|---|
committer | Julian Berman <Julian@GrayVines.com> | 2023-03-14 17:22:00 -0400 |
commit | f953e977ed555f3d0db1092d06def688a3db2b16 (patch) | |
tree | 484446b2e15b44c199ea9b636e0e8bddd504a6b6 /json/tests/draft6 | |
parent | 1c286a15d01bc31fa42e1d09fcd850ceda6d6129 (diff) | |
parent | 5e16d74500493ef164b595daec622c4ba199644e (diff) | |
download | jsonschema-f953e977ed555f3d0db1092d06def688a3db2b16.tar.gz |
Merge commit '5e16d74500493ef164b595daec622c4ba199644e'
* commit '5e16d74500493ef164b595daec622c4ba199644e':
Squashed 'json/' changes from f57d3e0cc..19947eaa1
Diffstat (limited to 'json/tests/draft6')
-rw-r--r-- | json/tests/draft6/additionalItems.json | 23 | ||||
-rw-r--r-- | json/tests/draft6/multipleOf.json | 11 | ||||
-rw-r--r-- | json/tests/draft6/ref.json | 33 |
3 files changed, 66 insertions, 1 deletions
diff --git a/json/tests/draft6/additionalItems.json b/json/tests/draft6/additionalItems.json index deb44fd..cae7236 100644 --- a/json/tests/draft6/additionalItems.json +++ b/json/tests/draft6/additionalItems.json @@ -21,6 +21,29 @@ { "description": "when items is schema, additionalItems does nothing", "schema": { + "items": { + "type": "integer" + }, + "additionalItems": { + "type": "string" + } + }, + "tests": [ + { + "description": "valid with a array of type integers", + "data": [1,2,3], + "valid": true + }, + { + "description": "invalid with a array of mixed types", + "data": [1,"2","3"], + "valid": false + } + ] + }, + { + "description": "when items is schema, boolean additionalItems does nothing", + "schema": { "items": {}, "additionalItems": false }, diff --git a/json/tests/draft6/multipleOf.json b/json/tests/draft6/multipleOf.json index 25c25a9..e606979 100644 --- a/json/tests/draft6/multipleOf.json +++ b/json/tests/draft6/multipleOf.json @@ -67,5 +67,16 @@ "valid": false } ] + }, + { + "description": "small multiple of large integer", + "schema": {"type": "integer", "multipleOf": 1e-8}, + "tests": [ + { + "description": "any integer is a multiple of 1e-8", + "data": 12391239123, + "valid": true + } + ] } ] diff --git a/json/tests/draft6/ref.json b/json/tests/draft6/ref.json index 1724f81..8a36593 100644 --- a/json/tests/draft6/ref.json +++ b/json/tests/draft6/ref.json @@ -782,5 +782,36 @@ "valid": false } ] - } + }, + { + "description": "ref with absolute-path-reference", + "schema": { + "$id": "http://example.com/ref/absref.json", + "definitions": { + "a": { + "$id": "http://example.com/ref/absref/foobar.json", + "type": "number" + }, + "b": { + "$id": "http://example.com/absref/foobar.json", + "type": "string" + } + }, + "allOf": [ + { "$ref": "/absref/foobar.json" } + ] + }, + "tests": [ + { + "description": "a string is valid", + "data": "foo", + "valid": true + }, + { + "description": "an integer is invalid", + "data": 12, + "valid": false + } + ] + } ] |