summaryrefslogtreecommitdiff
path: root/json/tests/draft7/optional/future-keywords.json
diff options
context:
space:
mode:
Diffstat (limited to 'json/tests/draft7/optional/future-keywords.json')
-rw-r--r--json/tests/draft7/optional/future-keywords.json433
1 files changed, 0 insertions, 433 deletions
diff --git a/json/tests/draft7/optional/future-keywords.json b/json/tests/draft7/optional/future-keywords.json
deleted file mode 100644
index 2df8421..0000000
--- a/json/tests/draft7/optional/future-keywords.json
+++ /dev/null
@@ -1,433 +0,0 @@
-[
- {
- "description": "$dynamicRef without $dynamicAnchor works like $ref",
- "schema": {
- "properties": {
- "foo": {"$dynamicRef": "#"}
- },
- "additionalProperties": false
- },
- "tests": [
- {
- "description": "match",
- "data": {"foo": false},
- "valid": true
- },
- {
- "description": "recursive match",
- "data": {"foo": {"foo": false}},
- "valid": true
- },
- {
- "description": "mismatch",
- "data": {"bar": false},
- "valid": false
- },
- {
- "description": "recursive mismatch (but $dynamicRef is ignored)",
- "data": {"foo": {"bar": false}},
- "valid": true
- }
- ]
- },
- {
- "description": "prefixItems: an array of schemas for items",
- "schema": {
- "prefixItems": [
- {"type": "integer"},
- {"type": "string"}
- ]
- },
- "tests": [
- {
- "description": "correct types",
- "data": [ 1, "foo" ],
- "valid": true
- },
- {
- "description": "wrong types",
- "data": [ "foo", 1 ],
- "valid": true
- },
- {
- "description": "incomplete array of items",
- "data": [ 1 ],
- "valid": true
- },
- {
- "description": "array with additional items",
- "data": [ 1, "foo", true ],
- "valid": true
- },
- {
- "description": "empty array",
- "data": [ ],
- "valid": true
- },
- {
- "description": "JavaScript pseudo-array is valid",
- "data": {
- "0": "invalid",
- "1": "valid",
- "length": 2
- },
- "valid": true
- }
- ]
- },
- {
- "description": "dependentSchemas: single dependency",
- "schema": {
- "dependentSchemas": {
- "bar": {
- "properties": {
- "foo": {"type": "integer"},
- "bar": {"type": "integer"}
- }
- }
- }
- },
- "tests": [
- {
- "description": "valid",
- "data": {"foo": 1, "bar": 2},
- "valid": true
- },
- {
- "description": "no dependency",
- "data": {"foo": "quux"},
- "valid": true
- },
- {
- "description": "wrong type",
- "data": {"foo": "quux", "bar": 2},
- "valid": true
- },
- {
- "description": "wrong type other",
- "data": {"foo": 2, "bar": "quux"},
- "valid": true
- },
- {
- "description": "wrong type both",
- "data": {"foo": "quux", "bar": "quux"},
- "valid": true
- }
- ]
- },
- {
- "description": "dependentRequired: single dependency",
- "schema": {"dependentRequired": {"bar": ["foo"]}},
- "tests": [
- {
- "description": "neither",
- "data": {},
- "valid": true
- },
- {
- "description": "nondependant",
- "data": {"foo": 1},
- "valid": true
- },
- {
- "description": "with dependency",
- "data": {"foo": 1, "bar": 2},
- "valid": true
- },
- {
- "description": "missing dependency",
- "data": {"bar": 2},
- "valid": true
- },
- {
- "description": "ignores arrays",
- "data": ["bar"],
- "valid": true
- },
- {
- "description": "ignores strings",
- "data": "foobar",
- "valid": true
- },
- {
- "description": "ignores other non-objects",
- "data": 12,
- "valid": true
- }
- ]
- },
- {
- "description": "unevaluatedItems false",
- "schema": {
- "type": "array",
- "unevaluatedItems": false
- },
- "tests": [
- {
- "description": "with no unevaluated items",
- "data": [],
- "valid": true
- },
- {
- "description": "with unevaluated items",
- "data": ["foo"],
- "valid": true
- }
- ]
- },
- {
- "description": "unevaluatedProperties schema",
- "schema": {
- "type": "object",
- "unevaluatedProperties": {
- "type": "string",
- "minLength": 3
- }
- },
- "tests": [
- {
- "description": "with no unevaluated properties",
- "data": {},
- "valid": true
- },
- {
- "description": "with valid unevaluated properties",
- "data": {
- "foo": "foo"
- },
- "valid": true
- },
- {
- "description": "with invalid unevaluated properties",
- "data": {
- "foo": "fo"
- },
- "valid": true
- }
- ]
- },
- {
- "description": "maxContains with contains",
- "schema": {
- "contains": {"const": 1},
- "maxContains": 1
- },
- "tests": [
- {
- "description": "empty data",
- "data": [ ],
- "valid": false
- },
- {
- "description": "all elements match, valid maxContains",
- "data": [ 1 ],
- "valid": true
- },
- {
- "description": "all elements match, invalid maxContains",
- "data": [ 1, 1 ],
- "valid": true
- },
- {
- "description": "some elements match, valid maxContains",
- "data": [ 1, 2 ],
- "valid": true
- },
- {
- "description": "some elements match, invalid maxContains",
- "data": [ 1, 2, 1 ],
- "valid": true
- }
- ]
- },
- {
- "description": "minContains=2 with contains",
- "schema": {
- "contains": {"const": 1},
- "minContains": 2
- },
- "tests": [
- {
- "description": "empty data",
- "data": [ ],
- "valid": false
- },
- {
- "description": "all elements match, invalid minContains",
- "data": [ 1 ],
- "valid": true
- },
- {
- "description": "some elements match, invalid minContains",
- "data": [ 1, 2 ],
- "valid": true
- },
- {
- "description": "all elements match, valid minContains (exactly as needed)",
- "data": [ 1, 1 ],
- "valid": true
- },
- {
- "description": "all elements match, valid minContains (more than needed)",
- "data": [ 1, 1, 1 ],
- "valid": true
- },
- {
- "description": "some elements match, valid minContains",
- "data": [ 1, 2, 1 ],
- "valid": true
- }
- ]
- },
- {
- "description": "minContains = 0",
- "schema": {
- "contains": {"const": 1},
- "minContains": 0
- },
- "tests": [
- {
- "description": "empty array is valid with minContains=0",
- "data": [ ],
- "valid": false
- },
- {
- "description": "minContains = 0 would make contains always pass",
- "data": [ 2 ],
- "valid": false
- }
- ]
- },
- {
- "description": "$recursiveRef without $recursiveAnchor works like $ref",
- "schema": {
- "properties": {
- "foo": { "$recursiveRef": "#" }
- },
- "additionalProperties": false
- },
- "tests": [
- {
- "description": "match",
- "data": {"foo": false},
- "valid": true
- },
- {
- "description": "recursive match",
- "data": { "foo": { "foo": false } },
- "valid": true
- },
- {
- "description": "mismatch",
- "data": { "bar": false },
- "valid": false
- },
- {
- "description": "recursive mismatch",
- "data": { "foo": { "bar": false } },
- "valid": true
- }
- ]
- },
- {
- "description": "$recursiveRef without using nesting",
- "schema": {
- "$id": "http://localhost:4242",
- "definitions": {
- "myobject": {
- "$id": "myobject.json",
- "$recursiveAnchor": true,
- "anyOf": [
- { "type": "string" },
- {
- "type": "object",
- "additionalProperties": { "$recursiveRef": "#" }
- }
- ]
- }
- },
- "anyOf": [
- { "type": "integer" },
- { "$ref": "#/definitions/myobject" }
- ]
- },
- "tests": [
- {
- "description": "integer matches at the outer level",
- "data": 1,
- "valid": true
- },
- {
- "description": "single level match",
- "data": { "foo": "hi" },
- "valid": true
- },
- {
- "description": "integer does not match as a property value",
- "data": { "foo": 1 },
- "valid": true
- },
- {
- "description": "two levels, additionalProperties always matches, 1",
- "data": { "foo": { "bar": "hi" } },
- "valid": true
- },
- {
- "description": "two levels, additionalProperties always matches, 2",
- "data": { "foo": { "bar": 1 } },
- "valid": true
- }
- ]
- },
- {
- "description": "$recursiveRef with nesting",
- "schema": {
- "$id": "http://localhost:4242",
- "$recursiveAnchor": true,
- "definitions": {
- "myobject": {
- "$id": "myobject.json",
- "$recursiveAnchor": true,
- "anyOf": [
- { "type": "string" },
- {
- "type": "object",
- "additionalProperties": { "$recursiveRef": "#" }
- }
- ]
- }
- },
- "anyOf": [
- { "type": "integer" },
- { "$ref": "#/definitions/myobject" }
- ]
- },
- "tests": [
- {
- "description": "integer matches at the outer level",
- "data": 1,
- "valid": true
- },
- {
- "description": "single level match",
- "data": { "foo": "hi" },
- "valid": true
- },
- {
- "description": "integer now matches as a property value",
- "data": { "foo": 1 },
- "valid": true
- },
- {
- "description": "two levels, properties match with inner definition",
- "data": { "foo": { "bar": "hi" } },
- "valid": true
- },
- {
- "description": "two levels, properties match with $recursiveRef",
- "data": { "foo": { "bar": 1 } },
- "valid": true
- }
- ]
- }
-]