diff --git a/tests/draft-next/anchor.json b/tests/draft-next/anchor.json index a0c4c51a..84d4851c 100644 --- a/tests/draft-next/anchor.json +++ b/tests/draft-next/anchor.json @@ -116,29 +116,5 @@ "valid": false } ] - }, - { - "description": "invalid anchors", - "schema": { - "$schema": "https://json-schema.org/draft/next/schema", - "$ref": "https://json-schema.org/draft/next/schema" - }, - "tests": [ - { - "description": "MUST start with a letter (and not #)", - "data": { "$anchor" : "#foo" }, - "valid": false - }, - { - "description": "JSON pointers are not valid", - "data": { "$anchor" : "/a/b" }, - "valid": false - }, - { - "description": "invalid with valid beginning", - "data": { "$anchor" : "foo#something" }, - "valid": false - } - ] } ] diff --git a/tests/draft-next/id.json b/tests/draft-next/id.json deleted file mode 100644 index fe74c6bf..00000000 --- a/tests/draft-next/id.json +++ /dev/null @@ -1,211 +0,0 @@ -[ - { - "description": "Invalid use of fragments in location-independent $id", - "schema": { - "$schema": "https://json-schema.org/draft/next/schema", - "$ref": "https://json-schema.org/draft/next/schema" - }, - "tests": [ - { - "description": "Identifier name", - "data": { - "$ref": "#foo", - "$defs": { - "A": { - "$id": "#foo", - "type": "integer" - } - } - }, - "valid": false - }, - { - "description": "Identifier name and no ref", - "data": { - "$defs": { - "A": { "$id": "#foo" } - } - }, - "valid": false - }, - { - "description": "Identifier path", - "data": { - "$ref": "#/a/b", - "$defs": { - "A": { - "$id": "#/a/b", - "type": "integer" - } - } - }, - "valid": false - }, - { - "description": "Identifier name with absolute URI", - "data": { - "$ref": "http://localhost:1234/draft-next/bar#foo", - "$defs": { - "A": { - "$id": "http://localhost:1234/draft-next/bar#foo", - "type": "integer" - } - } - }, - "valid": false - }, - { - "description": "Identifier path with absolute URI", - "data": { - "$ref": "http://localhost:1234/draft-next/bar#/a/b", - "$defs": { - "A": { - "$id": "http://localhost:1234/draft-next/bar#/a/b", - "type": "integer" - } - } - }, - "valid": false - }, - { - "description": "Identifier name with base URI change in subschema", - "data": { - "$id": "http://localhost:1234/draft-next/root", - "$ref": "http://localhost:1234/draft-next/nested.json#foo", - "$defs": { - "A": { - "$id": "nested.json", - "$defs": { - "B": { - "$id": "#foo", - "type": "integer" - } - } - } - } - }, - "valid": false - }, - { - "description": "Identifier path with base URI change in subschema", - "data": { - "$id": "http://localhost:1234/draft-next/root", - "$ref": "http://localhost:1234/draft-next/nested.json#/a/b", - "$defs": { - "A": { - "$id": "nested.json", - "$defs": { - "B": { - "$id": "#/a/b", - "type": "integer" - } - } - } - } - }, - "valid": false - } - ] - }, - { - "description": "Valid use of empty fragments in location-independent $id", - "comment": "These are allowed but discouraged", - "schema": { - "$schema": "https://json-schema.org/draft/next/schema", - "$ref": "https://json-schema.org/draft/next/schema" - }, - "tests": [ - { - "description": "Identifier name with absolute URI", - "data": { - "$ref": "http://localhost:1234/draft-next/bar", - "$defs": { - "A": { - "$id": "http://localhost:1234/draft-next/bar#", - "type": "integer" - } - } - }, - "valid": true - }, - { - "description": "Identifier name with base URI change in subschema", - "data": { - "$id": "http://localhost:1234/draft-next/root", - "$ref": "http://localhost:1234/draft-next/nested.json#/$defs/B", - "$defs": { - "A": { - "$id": "nested.json", - "$defs": { - "B": { - "$id": "#", - "type": "integer" - } - } - } - } - }, - "valid": true - } - ] - }, - { - "description": "Unnormalized $ids are allowed but discouraged", - "schema": { - "$schema": "https://json-schema.org/draft/next/schema", - "$ref": "https://json-schema.org/draft/next/schema" - }, - "tests": [ - { - "description": "Unnormalized identifier", - "data": { - "$ref": "http://localhost:1234/draft-next/foo/baz", - "$defs": { - "A": { - "$id": "http://localhost:1234/draft-next/foo/bar/../baz", - "type": "integer" - } - } - }, - "valid": true - }, - { - "description": "Unnormalized identifier and no ref", - "data": { - "$defs": { - "A": { - "$id": "http://localhost:1234/draft-next/foo/bar/../baz", - "type": "integer" - } - } - }, - "valid": true - }, - { - "description": "Unnormalized identifier with empty fragment", - "data": { - "$ref": "http://localhost:1234/draft-next/foo/baz", - "$defs": { - "A": { - "$id": "http://localhost:1234/draft-next/foo/bar/../baz#", - "type": "integer" - } - } - }, - "valid": true - }, - { - "description": "Unnormalized identifier with empty fragment and no ref", - "data": { - "$defs": { - "A": { - "$id": "http://localhost:1234/draft-next/foo/bar/../baz#", - "type": "integer" - } - } - }, - "valid": true - } - ] - } -] diff --git a/tests/draft2019-09/anchor.json b/tests/draft2019-09/anchor.json index eb0a969a..bce05e80 100644 --- a/tests/draft2019-09/anchor.json +++ b/tests/draft2019-09/anchor.json @@ -116,30 +116,5 @@ "valid": false } ] - }, - { - "description": "invalid anchors", - "comment": "Section 8.2.3", - "schema": { - "$schema": "https://json-schema.org/draft/2019-09/schema", - "$ref": "https://json-schema.org/draft/2019-09/schema" - }, - "tests": [ - { - "description": "MUST start with a letter (and not #)", - "data": { "$anchor" : "#foo" }, - "valid": false - }, - { - "description": "JSON pointers are not valid", - "data": { "$anchor" : "/a/b" }, - "valid": false - }, - { - "description": "invalid with valid beginning", - "data": { "$anchor" : "foo#something" }, - "valid": false - } - ] } ] diff --git a/tests/draft2019-09/id.json b/tests/draft2019-09/id.json deleted file mode 100644 index 0ba31387..00000000 --- a/tests/draft2019-09/id.json +++ /dev/null @@ -1,211 +0,0 @@ -[ - { - "description": "Invalid use of fragments in location-independent $id", - "schema": { - "$schema": "https://json-schema.org/draft/2019-09/schema", - "$ref": "https://json-schema.org/draft/2019-09/schema" - }, - "tests": [ - { - "description": "Identifier name", - "data": { - "$ref": "#foo", - "$defs": { - "A": { - "$id": "#foo", - "type": "integer" - } - } - }, - "valid": false - }, - { - "description": "Identifier name and no ref", - "data": { - "$defs": { - "A": { "$id": "#foo" } - } - }, - "valid": false - }, - { - "description": "Identifier path", - "data": { - "$ref": "#/a/b", - "$defs": { - "A": { - "$id": "#/a/b", - "type": "integer" - } - } - }, - "valid": false - }, - { - "description": "Identifier name with absolute URI", - "data": { - "$ref": "http://localhost:1234/draft2019-09/bar#foo", - "$defs": { - "A": { - "$id": "http://localhost:1234/draft2019-09/bar#foo", - "type": "integer" - } - } - }, - "valid": false - }, - { - "description": "Identifier path with absolute URI", - "data": { - "$ref": "http://localhost:1234/draft2019-09/bar#/a/b", - "$defs": { - "A": { - "$id": "http://localhost:1234/draft2019-09/bar#/a/b", - "type": "integer" - } - } - }, - "valid": false - }, - { - "description": "Identifier name with base URI change in subschema", - "data": { - "$id": "http://localhost:1234/draft2019-09/root", - "$ref": "http://localhost:1234/draft2019-09/nested.json#foo", - "$defs": { - "A": { - "$id": "nested.json", - "$defs": { - "B": { - "$id": "#foo", - "type": "integer" - } - } - } - } - }, - "valid": false - }, - { - "description": "Identifier path with base URI change in subschema", - "data": { - "$id": "http://localhost:1234/draft2019-09/root", - "$ref": "http://localhost:1234/draft2019-09/nested.json#/a/b", - "$defs": { - "A": { - "$id": "nested.json", - "$defs": { - "B": { - "$id": "#/a/b", - "type": "integer" - } - } - } - } - }, - "valid": false - } - ] - }, - { - "description": "Valid use of empty fragments in location-independent $id", - "comment": "These are allowed but discouraged", - "schema": { - "$schema": "https://json-schema.org/draft/2019-09/schema", - "$ref": "https://json-schema.org/draft/2019-09/schema" - }, - "tests": [ - { - "description": "Identifier name with absolute URI", - "data": { - "$ref": "http://localhost:1234/draft2019-09/bar", - "$defs": { - "A": { - "$id": "http://localhost:1234/draft2019-09/bar#", - "type": "integer" - } - } - }, - "valid": true - }, - { - "description": "Identifier name with base URI change in subschema", - "data": { - "$id": "http://localhost:1234/draft2019-09/root", - "$ref": "http://localhost:1234/draft2019-09/nested.json#/$defs/B", - "$defs": { - "A": { - "$id": "nested.json", - "$defs": { - "B": { - "$id": "#", - "type": "integer" - } - } - } - } - }, - "valid": true - } - ] - }, - { - "description": "Unnormalized $ids are allowed but discouraged", - "schema": { - "$schema": "https://json-schema.org/draft/2019-09/schema", - "$ref": "https://json-schema.org/draft/2019-09/schema" - }, - "tests": [ - { - "description": "Unnormalized identifier", - "data": { - "$ref": "http://localhost:1234/draft2019-09/foo/baz", - "$defs": { - "A": { - "$id": "http://localhost:1234/draft2019-09/foo/bar/../baz", - "type": "integer" - } - } - }, - "valid": true - }, - { - "description": "Unnormalized identifier and no ref", - "data": { - "$defs": { - "A": { - "$id": "http://localhost:1234/draft2019-09/foo/bar/../baz", - "type": "integer" - } - } - }, - "valid": true - }, - { - "description": "Unnormalized identifier with empty fragment", - "data": { - "$ref": "http://localhost:1234/draft2019-09/foo/baz", - "$defs": { - "A": { - "$id": "http://localhost:1234/draft2019-09/foo/bar/../baz#", - "type": "integer" - } - } - }, - "valid": true - }, - { - "description": "Unnormalized identifier with empty fragment and no ref", - "data": { - "$defs": { - "A": { - "$id": "http://localhost:1234/draft2019-09/foo/bar/../baz#", - "type": "integer" - } - } - }, - "valid": true - } - ] - } -] diff --git a/tests/draft2019-09/ref.json b/tests/draft2019-09/ref.json index ea569908..8f9cc913 100644 --- a/tests/draft2019-09/ref.json +++ b/tests/draft2019-09/ref.json @@ -791,21 +791,6 @@ } ] }, - { - "description": "URN base URI with f-component", - "schema": { - "$schema": "https://json-schema.org/draft/2019-09/schema", - "$comment": "RFC 8141 §2.3.3, but we don't allow fragments", - "$ref": "https://json-schema.org/draft/2019-09/schema" - }, - "tests": [ - { - "description": "is invalid", - "data": {"$id": "urn:example:foo-bar-baz-qux#somepart"}, - "valid": false - } - ] - }, { "description": "URN base URI with URN and JSON pointer ref", "schema": { diff --git a/tests/draft2020-12/anchor.json b/tests/draft2020-12/anchor.json index 83a7166d..99143fa1 100644 --- a/tests/draft2020-12/anchor.json +++ b/tests/draft2020-12/anchor.json @@ -116,30 +116,5 @@ "valid": false } ] - }, - { - "description": "invalid anchors", - "comment": "Section 8.2.2", - "schema": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$ref": "https://json-schema.org/draft/2020-12/schema" - }, - "tests": [ - { - "description": "MUST start with a letter (and not #)", - "data": { "$anchor" : "#foo" }, - "valid": false - }, - { - "description": "JSON pointers are not valid", - "data": { "$anchor" : "/a/b" }, - "valid": false - }, - { - "description": "invalid with valid beginning", - "data": { "$anchor" : "foo#something" }, - "valid": false - } - ] } ] diff --git a/tests/draft2020-12/id.json b/tests/draft2020-12/id.json deleted file mode 100644 index 59265c4e..00000000 --- a/tests/draft2020-12/id.json +++ /dev/null @@ -1,211 +0,0 @@ -[ - { - "description": "Invalid use of fragments in location-independent $id", - "schema": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$ref": "https://json-schema.org/draft/2020-12/schema" - }, - "tests": [ - { - "description": "Identifier name", - "data": { - "$ref": "#foo", - "$defs": { - "A": { - "$id": "#foo", - "type": "integer" - } - } - }, - "valid": false - }, - { - "description": "Identifier name and no ref", - "data": { - "$defs": { - "A": { "$id": "#foo" } - } - }, - "valid": false - }, - { - "description": "Identifier path", - "data": { - "$ref": "#/a/b", - "$defs": { - "A": { - "$id": "#/a/b", - "type": "integer" - } - } - }, - "valid": false - }, - { - "description": "Identifier name with absolute URI", - "data": { - "$ref": "http://localhost:1234/draft2020-12/bar#foo", - "$defs": { - "A": { - "$id": "http://localhost:1234/draft2020-12/bar#foo", - "type": "integer" - } - } - }, - "valid": false - }, - { - "description": "Identifier path with absolute URI", - "data": { - "$ref": "http://localhost:1234/draft2020-12/bar#/a/b", - "$defs": { - "A": { - "$id": "http://localhost:1234/draft2020-12/bar#/a/b", - "type": "integer" - } - } - }, - "valid": false - }, - { - "description": "Identifier name with base URI change in subschema", - "data": { - "$id": "http://localhost:1234/draft2020-12/root", - "$ref": "http://localhost:1234/draft2020-12/nested.json#foo", - "$defs": { - "A": { - "$id": "nested.json", - "$defs": { - "B": { - "$id": "#foo", - "type": "integer" - } - } - } - } - }, - "valid": false - }, - { - "description": "Identifier path with base URI change in subschema", - "data": { - "$id": "http://localhost:1234/draft2020-12/root", - "$ref": "http://localhost:1234/draft2020-12/nested.json#/a/b", - "$defs": { - "A": { - "$id": "nested.json", - "$defs": { - "B": { - "$id": "#/a/b", - "type": "integer" - } - } - } - } - }, - "valid": false - } - ] - }, - { - "description": "Valid use of empty fragments in location-independent $id", - "comment": "These are allowed but discouraged", - "schema": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$ref": "https://json-schema.org/draft/2020-12/schema" - }, - "tests": [ - { - "description": "Identifier name with absolute URI", - "data": { - "$ref": "http://localhost:1234/draft2020-12/bar", - "$defs": { - "A": { - "$id": "http://localhost:1234/draft2020-12/bar#", - "type": "integer" - } - } - }, - "valid": true - }, - { - "description": "Identifier name with base URI change in subschema", - "data": { - "$id": "http://localhost:1234/draft2020-12/root", - "$ref": "http://localhost:1234/draft2020-12/nested.json#/$defs/B", - "$defs": { - "A": { - "$id": "nested.json", - "$defs": { - "B": { - "$id": "#", - "type": "integer" - } - } - } - } - }, - "valid": true - } - ] - }, - { - "description": "Unnormalized $ids are allowed but discouraged", - "schema": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$ref": "https://json-schema.org/draft/2020-12/schema" - }, - "tests": [ - { - "description": "Unnormalized identifier", - "data": { - "$ref": "http://localhost:1234/draft2020-12/foo/baz", - "$defs": { - "A": { - "$id": "http://localhost:1234/draft2020-12/foo/bar/../baz", - "type": "integer" - } - } - }, - "valid": true - }, - { - "description": "Unnormalized identifier and no ref", - "data": { - "$defs": { - "A": { - "$id": "http://localhost:1234/draft2020-12/foo/bar/../baz", - "type": "integer" - } - } - }, - "valid": true - }, - { - "description": "Unnormalized identifier with empty fragment", - "data": { - "$ref": "http://localhost:1234/draft2020-12/foo/baz", - "$defs": { - "A": { - "$id": "http://localhost:1234/draft2020-12/foo/bar/../baz#", - "type": "integer" - } - } - }, - "valid": true - }, - { - "description": "Unnormalized identifier with empty fragment and no ref", - "data": { - "$defs": { - "A": { - "$id": "http://localhost:1234/draft2020-12/foo/bar/../baz#", - "type": "integer" - } - } - }, - "valid": true - } - ] - } -] diff --git a/tests/draft2020-12/ref.json b/tests/draft2020-12/ref.json index 8d15fa43..a1d3efaf 100644 --- a/tests/draft2020-12/ref.json +++ b/tests/draft2020-12/ref.json @@ -791,21 +791,6 @@ } ] }, - { - "description": "URN base URI with f-component", - "schema": { - "$comment": "RFC 8141 §2.3.3, but we don't allow fragments", - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$ref": "https://json-schema.org/draft/2020-12/schema" - }, - "tests": [ - { - "description": "is invalid", - "data": {"$id": "urn:example:foo-bar-baz-qux#somepart"}, - "valid": false - } - ] - }, { "description": "URN base URI with URN and JSON pointer ref", "schema": {