From a47f148ce8a28932a7de98b6ffefd0c9f12d8f46 Mon Sep 17 00:00:00 2001 From: David Harsha Date: Thu, 16 Nov 2023 14:30:55 -0800 Subject: [PATCH] Update fixtures From json-schema-test-suite update. --- test/fixtures/draft2019-09.json | 206 ++++++++++++++++++++++++++++++ test/fixtures/draft2020-12.json | 214 ++++++++++++++++++++++++++++++++ test/fixtures/draft4.json | 89 +++++++++++-- test/fixtures/draft6.json | 89 +++++++++++-- test/fixtures/draft7.json | 101 +++++++++++++-- 5 files changed, 663 insertions(+), 36 deletions(-) diff --git a/test/fixtures/draft2019-09.json b/test/fixtures/draft2019-09.json index f7007ba4..da884b6e 100644 --- a/test/fixtures/draft2019-09.json +++ b/test/fixtures/draft2019-09.json @@ -190,6 +190,43 @@ } ] ], + [ + [ + { + "data": "bar", + "data_pointer": "/1", + "schema": false, + "schema_pointer": "/additionalItems", + "root_schema": { + "$schema": "https://json-schema.org/draft/2019-09/schema", + "items": [ + { + } + ], + "additionalItems": false + }, + "type": "schema" + }, + { + "data": 37, + "data_pointer": "/2", + "schema": false, + "schema_pointer": "/additionalItems", + "root_schema": { + "$schema": "https://json-schema.org/draft/2019-09/schema", + "items": [ + { + } + ], + "additionalItems": false + }, + "type": "schema" + } + ], + [ + + ] + ], [ [ @@ -4210,6 +4247,7 @@ "schema": false, "schema_pointer": "/dependentSchemas/foo/additionalProperties", "root_schema": { + "$schema": "https://json-schema.org/draft/2019-09/schema", "properties": { "foo": { } @@ -4237,6 +4275,7 @@ "schema": false, "schema_pointer": "/dependentSchemas/foo/additionalProperties", "root_schema": { + "$schema": "https://json-schema.org/draft/2019-09/schema", "properties": { "foo": { } @@ -12021,6 +12060,21 @@ }, "type": "format" } + ], + [ + + ], + [ + + ], + [ + + ], + [ + + ], + [ + ] ] ], @@ -12615,6 +12669,21 @@ ], [ + ], + [ + + ], + [ + + ], + [ + + ], + [ + + ], + [ + ] ] ], @@ -12755,6 +12824,22 @@ }, "type": "format" } + ], + [ + { + "data": "192.168.1.0/24", + "data_pointer": "", + "schema": { + "$schema": "https://json-schema.org/draft/2019-09/schema", + "format": "ipv4" + }, + "schema_pointer": "", + "root_schema": { + "$schema": "https://json-schema.org/draft/2019-09/schema", + "format": "ipv4" + }, + "type": "format" + } ] ] ], @@ -14983,6 +15068,32 @@ "type": "integer" } ] + ], + [ + [ + + ], + [ + { + "data": 42, + "data_pointer": "", + "schema": { + "type": "string" + }, + "schema_pointer": "/examples/0", + "root_schema": { + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "/base", + "examples": [ + { + "type": "string" + } + ], + "$ref": "#/examples/0" + }, + "type": "string" + } + ] ] ], "JSON-Schema-Test-Suite/tests/draft2019-09/pattern.json": [ @@ -19119,6 +19230,7 @@ }, "schema_pointer": "/$defs/foo/$defs/bar", "root_schema": { + "$schema": "https://json-schema.org/draft/2019-09/schema", "$ref": "urn:uuid:deadbeef-4321-ffff-ffff-1234feebdaed", "$defs": { "foo": { @@ -19147,6 +19259,7 @@ }, "schema_pointer": "/if", "root_schema": { + "$schema": "https://json-schema.org/draft/2019-09/schema", "$ref": "http://example.com/ref/if", "if": { "$id": "http://example.com/ref/if", @@ -19171,6 +19284,7 @@ }, "schema_pointer": "/then", "root_schema": { + "$schema": "https://json-schema.org/draft/2019-09/schema", "$ref": "http://example.com/ref/then", "then": { "$id": "http://example.com/ref/then", @@ -19195,6 +19309,7 @@ }, "schema_pointer": "/else", "root_schema": { + "$schema": "https://json-schema.org/draft/2019-09/schema", "$ref": "http://example.com/ref/else", "else": { "$id": "http://example.com/ref/else", @@ -19222,6 +19337,7 @@ }, "schema_pointer": "/$defs/b", "root_schema": { + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "http://example.com/ref/absref.json", "$defs": { "a": { @@ -19252,6 +19368,7 @@ }, "schema_pointer": "/$defs/foo", "root_schema": { + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "file:///folder/file.json", "$defs": { "foo": { @@ -19277,6 +19394,7 @@ }, "schema_pointer": "/$defs/foo", "root_schema": { + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "file:///c:/folder/file.json", "$defs": { "foo": { @@ -19302,6 +19420,7 @@ }, "schema_pointer": "/$defs//$defs/", "root_schema": { + "$schema": "https://json-schema.org/draft/2019-09/schema", "$defs": { "": { "$defs": { @@ -21655,6 +21774,50 @@ } ] ], + [ + [ + + ], + [ + { + "data": "too many", + "data_pointer": "/1/3", + "schema": false, + "schema_pointer": "/$defs/tree/items/1/unevaluatedItems", + "root_schema": { + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://example.com/extended-tree", + "$recursiveAnchor": true, + "$ref": "/tree", + "items": [ + true, + true, + { + "type": "string" + } + ], + "$defs": { + "tree": { + "$id": "/tree", + "$recursiveAnchor": true, + "type": "array", + "items": [ + { + "type": "number" + }, + { + "$comment": "unevaluatedItems comes first so it's more likely to catch bugs with implementations that are sensitive to keyword ordering", + "unevaluatedItems": false, + "$recursiveRef": "#" + } + ] + } + } + }, + "type": "schema" + } + ] + ], [ [ { @@ -22625,6 +22788,49 @@ } ] ], + [ + [ + + ], + [ + { + "data": "b", + "data_pointer": "/branches/foo", + "schema": false, + "schema_pointer": "/$defs/tree/properties/branches/unevaluatedProperties", + "root_schema": { + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://example.com/extended-tree", + "$recursiveAnchor": true, + "$ref": "/tree", + "properties": { + "name": { + "type": "string" + } + }, + "$defs": { + "tree": { + "$id": "/tree", + "$recursiveAnchor": true, + "type": "object", + "properties": { + "node": true, + "branches": { + "$comment": "unevaluatedProperties comes first so it's more likely to bugs errors with implementations that are sensitive to keyword ordering", + "unevaluatedProperties": false, + "$recursiveRef": "#" + } + }, + "required": [ + "node" + ] + } + } + }, + "type": "schema" + } + ] + ], [ [ { diff --git a/test/fixtures/draft2020-12.json b/test/fixtures/draft2020-12.json index a21dc28a..7ffbab6a 100644 --- a/test/fixtures/draft2020-12.json +++ b/test/fixtures/draft2020-12.json @@ -4028,6 +4028,7 @@ "schema": false, "schema_pointer": "/dependentSchemas/foo/additionalProperties", "root_schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", "properties": { "foo": { } @@ -4055,6 +4056,7 @@ "schema": false, "schema_pointer": "/dependentSchemas/foo/additionalProperties", "root_schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", "properties": { "foo": { } @@ -7933,6 +7935,43 @@ } ] ], + [ + [ + { + "data": "bar", + "data_pointer": "/1", + "schema": false, + "schema_pointer": "/items", + "root_schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "prefixItems": [ + { + } + ], + "items": false + }, + "type": "schema" + }, + { + "data": 37, + "data_pointer": "/2", + "schema": false, + "schema_pointer": "/items", + "root_schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "prefixItems": [ + { + } + ], + "items": false + }, + "type": "schema" + } + ], + [ + + ] + ], [ [ @@ -13249,6 +13288,21 @@ }, "type": "format" } + ], + [ + + ], + [ + + ], + [ + + ], + [ + + ], + [ + ] ] ], @@ -13843,6 +13897,21 @@ ], [ + ], + [ + + ], + [ + + ], + [ + + ], + [ + + ], + [ + ] ] ], @@ -13983,6 +14052,22 @@ }, "type": "format" } + ], + [ + { + "data": "192.168.1.0/24", + "data_pointer": "", + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "format": "ipv4" + }, + "schema_pointer": "", + "root_schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "format": "ipv4" + }, + "type": "format" + } ] ] ], @@ -16259,6 +16344,32 @@ "type": "integer" } ] + ], + [ + [ + + ], + [ + { + "data": 42, + "data_pointer": "", + "schema": { + "type": "string" + }, + "schema_pointer": "/examples/0", + "root_schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "/base", + "examples": [ + { + "type": "string" + } + ], + "$ref": "#/examples/0" + }, + "type": "string" + } + ] ] ], "JSON-Schema-Test-Suite/tests/draft2020-12/pattern.json": [ @@ -18593,6 +18704,7 @@ }, "schema_pointer": "/$defs/foo/$defs/bar", "root_schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", "$ref": "urn:uuid:deadbeef-4321-ffff-ffff-1234feebdaed", "$defs": { "foo": { @@ -18621,6 +18733,7 @@ }, "schema_pointer": "/if", "root_schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", "$ref": "http://example.com/ref/if", "if": { "$id": "http://example.com/ref/if", @@ -18645,6 +18758,7 @@ }, "schema_pointer": "/then", "root_schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", "$ref": "http://example.com/ref/then", "then": { "$id": "http://example.com/ref/then", @@ -18669,6 +18783,7 @@ }, "schema_pointer": "/else", "root_schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", "$ref": "http://example.com/ref/else", "else": { "$id": "http://example.com/ref/else", @@ -18696,6 +18811,7 @@ }, "schema_pointer": "/$defs/b", "root_schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "http://example.com/ref/absref.json", "$defs": { "a": { @@ -18726,6 +18842,7 @@ }, "schema_pointer": "/$defs/foo", "root_schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "file:///folder/file.json", "$defs": { "foo": { @@ -18751,6 +18868,7 @@ }, "schema_pointer": "/$defs/foo", "root_schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "file:///c:/folder/file.json", "$defs": { "foo": { @@ -18776,6 +18894,7 @@ }, "schema_pointer": "/$defs//$defs/", "root_schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", "$defs": { "": { "$defs": { @@ -21136,6 +21255,54 @@ } ] ], + [ + [ + + ], + [ + { + "data": "baz", + "data_pointer": "/2", + "schema": false, + "schema_pointer": "/$defs/baseSchema/unevaluatedItems", + "root_schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://example.com/derived", + "$ref": "/baseSchema", + "$defs": { + "derived": { + "$dynamicAnchor": "addons", + "prefixItems": [ + true, + { + "type": "string" + } + ] + }, + "baseSchema": { + "$id": "/baseSchema", + "$comment": "unevaluatedItems comes first so it's more likely to catch bugs with implementations that are sensitive to keyword ordering", + "unevaluatedItems": false, + "type": "array", + "prefixItems": [ + { + "type": "string" + } + ], + "$dynamicRef": "#addons", + "$defs": { + "defaultAddons": { + "$comment": "Needed to satisfy the bookending requirement", + "$dynamicAnchor": "addons" + } + } + } + } + }, + "type": "schema" + } + ] + ], [ [ { @@ -22594,6 +22761,53 @@ } ] ], + [ + [ + + ], + [ + { + "data": "baz", + "data_pointer": "/baz", + "schema": false, + "schema_pointer": "/$defs/baseSchema/unevaluatedProperties", + "root_schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://example.com/derived", + "$ref": "/baseSchema", + "$defs": { + "derived": { + "$dynamicAnchor": "addons", + "properties": { + "bar": { + "type": "string" + } + } + }, + "baseSchema": { + "$id": "/baseSchema", + "$comment": "unevaluatedProperties comes first so it's more likely to catch bugs with implementations that are sensitive to keyword ordering", + "unevaluatedProperties": false, + "type": "object", + "properties": { + "foo": { + "type": "string" + } + }, + "$dynamicRef": "#addons", + "$defs": { + "defaultAddons": { + "$comment": "Needed to satisfy the bookending requirement", + "$dynamicAnchor": "addons" + } + } + } + } + }, + "type": "schema" + } + ] + ], [ [ { diff --git a/test/fixtures/draft4.json b/test/fixtures/draft4.json index 4eb61ce1..9850ed7e 100644 --- a/test/fixtures/draft4.json +++ b/test/fixtures/draft4.json @@ -143,6 +143,41 @@ } ] ], + [ + [ + { + "data": "bar", + "data_pointer": "/1", + "schema": false, + "schema_pointer": "/additionalItems", + "root_schema": { + "items": [ + { + } + ], + "additionalItems": false + }, + "type": "schema" + }, + { + "data": 37, + "data_pointer": "/2", + "schema": false, + "schema_pointer": "/additionalItems", + "root_schema": { + "items": [ + { + } + ], + "additionalItems": false + }, + "type": "schema" + } + ], + [ + + ] + ], [ [ @@ -6451,6 +6486,18 @@ }, "type": "format" } + ], + [ + + ], + [ + + ], + [ + + ], + [ + ] ] ], @@ -6577,6 +6624,20 @@ }, "type": "format" } + ], + [ + { + "data": "192.168.1.0/24", + "data_pointer": "", + "schema": { + "format": "ipv4" + }, + "schema_pointer": "", + "root_schema": { + "format": "ipv4" + }, + "type": "format" + } ] ] ], @@ -9020,13 +9081,15 @@ "schema": { "type": "integer" }, - "schema_pointer": "/integer", + "schema_pointer": "/definitions/integer", "root_schema": { - "integer": { - "type": "integer" - }, - "refToInteger": { - "$ref": "#/integer" + "definitions": { + "integer": { + "type": "integer" + }, + "refToInteger": { + "$ref": "#/definitions/integer" + } } }, "type": "integer" @@ -9044,13 +9107,15 @@ "schema": { "type": "integer" }, - "schema_pointer": "/integer", + "schema_pointer": "/definitions/integer", "root_schema": { - "integer": { - "type": "integer" - }, - "refToInteger": { - "$ref": "#/integer" + "definitions": { + "integer": { + "type": "integer" + }, + "refToInteger": { + "$ref": "#/definitions/integer" + } } }, "type": "integer" diff --git a/test/fixtures/draft6.json b/test/fixtures/draft6.json index 1ad115bf..4ae2b503 100644 --- a/test/fixtures/draft6.json +++ b/test/fixtures/draft6.json @@ -184,6 +184,41 @@ } ] ], + [ + [ + { + "data": "bar", + "data_pointer": "/1", + "schema": false, + "schema_pointer": "/additionalItems", + "root_schema": { + "items": [ + { + } + ], + "additionalItems": false + }, + "type": "schema" + }, + { + "data": 37, + "data_pointer": "/2", + "schema": false, + "schema_pointer": "/additionalItems", + "root_schema": { + "items": [ + { + } + ], + "additionalItems": false + }, + "type": "schema" + } + ], + [ + + ] + ], [ [ @@ -8117,6 +8152,18 @@ }, "type": "format" } + ], + [ + + ], + [ + + ], + [ + + ], + [ + ] ] ], @@ -8243,6 +8290,20 @@ }, "type": "format" } + ], + [ + { + "data": "192.168.1.0/24", + "data_pointer": "", + "schema": { + "format": "ipv4" + }, + "schema_pointer": "", + "root_schema": { + "format": "ipv4" + }, + "type": "format" + } ] ] ], @@ -11664,13 +11725,15 @@ "schema": { "type": "integer" }, - "schema_pointer": "/integer", + "schema_pointer": "/definitions/integer", "root_schema": { - "integer": { - "type": "integer" - }, - "refToInteger": { - "$ref": "#/integer" + "definitions": { + "integer": { + "type": "integer" + }, + "refToInteger": { + "$ref": "#/definitions/integer" + } } }, "type": "integer" @@ -11688,13 +11751,15 @@ "schema": { "type": "integer" }, - "schema_pointer": "/integer", + "schema_pointer": "/definitions/integer", "root_schema": { - "integer": { - "type": "integer" - }, - "refToInteger": { - "$ref": "#/integer" + "definitions": { + "integer": { + "type": "integer" + }, + "refToInteger": { + "$ref": "#/definitions/integer" + } } }, "type": "integer" diff --git a/test/fixtures/draft7.json b/test/fixtures/draft7.json index 522d49af..6c8092e8 100644 --- a/test/fixtures/draft7.json +++ b/test/fixtures/draft7.json @@ -184,6 +184,41 @@ } ] ], + [ + [ + { + "data": "bar", + "data_pointer": "/1", + "schema": false, + "schema_pointer": "/additionalItems", + "root_schema": { + "items": [ + { + } + ], + "additionalItems": false + }, + "type": "schema" + }, + { + "data": 37, + "data_pointer": "/2", + "schema": false, + "schema_pointer": "/additionalItems", + "root_schema": { + "items": [ + { + } + ], + "additionalItems": false + }, + "type": "schema" + } + ], + [ + + ] + ], [ [ @@ -9052,6 +9087,18 @@ }, "type": "format" } + ], + [ + + ], + [ + + ], + [ + + ], + [ + ] ] ], @@ -9584,6 +9631,18 @@ ], [ + ], + [ + + ], + [ + + ], + [ + + ], + [ + ] ] ], @@ -9710,6 +9769,20 @@ }, "type": "format" } + ], + [ + { + "data": "192.168.1.0/24", + "data_pointer": "", + "schema": { + "format": "ipv4" + }, + "schema_pointer": "", + "root_schema": { + "format": "ipv4" + }, + "type": "format" + } ] ] ], @@ -14049,13 +14122,15 @@ "schema": { "type": "integer" }, - "schema_pointer": "/integer", + "schema_pointer": "/definitions/integer", "root_schema": { - "integer": { - "type": "integer" - }, - "refToInteger": { - "$ref": "#/integer" + "definitions": { + "integer": { + "type": "integer" + }, + "refToInteger": { + "$ref": "#/definitions/integer" + } } }, "type": "integer" @@ -14073,13 +14148,15 @@ "schema": { "type": "integer" }, - "schema_pointer": "/integer", + "schema_pointer": "/definitions/integer", "root_schema": { - "integer": { - "type": "integer" - }, - "refToInteger": { - "$ref": "#/integer" + "definitions": { + "integer": { + "type": "integer" + }, + "refToInteger": { + "$ref": "#/definitions/integer" + } } }, "type": "integer"