diff --git a/remotes/subSchemas.json b/remotes/draft3/subSchemas.json similarity index 100% rename from remotes/subSchemas.json rename to remotes/draft3/subSchemas.json diff --git a/remotes/locationIndependentIdentifierDraft4.json b/remotes/draft4/locationIndependentIdentifier.json similarity index 100% rename from remotes/locationIndependentIdentifierDraft4.json rename to remotes/draft4/locationIndependentIdentifier.json diff --git a/remotes/name.json b/remotes/draft4/name.json similarity index 100% rename from remotes/name.json rename to remotes/draft4/name.json diff --git a/remotes/draft4/subSchemas.json b/remotes/draft4/subSchemas.json new file mode 100644 index 00000000..6e9b3de3 --- /dev/null +++ b/remotes/draft4/subSchemas.json @@ -0,0 +1,10 @@ +{ + "definitions": { + "integer": { + "type": "integer" + }, + "refToInteger": { + "$ref": "#/definitions/integer" + } + } +} diff --git a/remotes/locationIndependentIdentifierPre2019.json b/remotes/draft6/locationIndependentIdentifier.json similarity index 100% rename from remotes/locationIndependentIdentifierPre2019.json rename to remotes/draft6/locationIndependentIdentifier.json diff --git a/remotes/draft6/name.json b/remotes/draft6/name.json new file mode 100644 index 00000000..fceacb80 --- /dev/null +++ b/remotes/draft6/name.json @@ -0,0 +1,15 @@ +{ + "definitions": { + "orNull": { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#" + } + ] + } + }, + "type": "string" +} diff --git a/remotes/ref-and-definitions.json b/remotes/draft6/ref-and-definitions.json similarity index 74% rename from remotes/ref-and-definitions.json rename to remotes/draft6/ref-and-definitions.json index e0ee802a..b80deeb7 100644 --- a/remotes/ref-and-definitions.json +++ b/remotes/draft6/ref-and-definitions.json @@ -1,5 +1,5 @@ { - "$id": "http://localhost:1234/ref-and-definitions.json", + "$id": "http://localhost:1234/draft6/ref-and-definitions.json", "definitions": { "inner": { "properties": { diff --git a/remotes/draft6/subSchemas.json b/remotes/draft6/subSchemas.json new file mode 100644 index 00000000..6e9b3de3 --- /dev/null +++ b/remotes/draft6/subSchemas.json @@ -0,0 +1,10 @@ +{ + "definitions": { + "integer": { + "type": "integer" + }, + "refToInteger": { + "$ref": "#/definitions/integer" + } + } +} diff --git a/remotes/draft7/locationIndependentIdentifier.json b/remotes/draft7/locationIndependentIdentifier.json new file mode 100644 index 00000000..e72815cd --- /dev/null +++ b/remotes/draft7/locationIndependentIdentifier.json @@ -0,0 +1,11 @@ +{ + "definitions": { + "refToInteger": { + "$ref": "#foo" + }, + "A": { + "$id": "#foo", + "type": "integer" + } + } +} diff --git a/remotes/draft7/name.json b/remotes/draft7/name.json new file mode 100644 index 00000000..fceacb80 --- /dev/null +++ b/remotes/draft7/name.json @@ -0,0 +1,15 @@ +{ + "definitions": { + "orNull": { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#" + } + ] + } + }, + "type": "string" +} diff --git a/remotes/draft7/ref-and-definitions.json b/remotes/draft7/ref-and-definitions.json new file mode 100644 index 00000000..d5929380 --- /dev/null +++ b/remotes/draft7/ref-and-definitions.json @@ -0,0 +1,11 @@ +{ + "$id": "http://localhost:1234/draft7/ref-and-definitions.json", + "definitions": { + "inner": { + "properties": { + "bar": { "type": "string" } + } + } + }, + "allOf": [ { "$ref": "#/definitions/inner" } ] +} diff --git a/remotes/draft7/subSchemas.json b/remotes/draft7/subSchemas.json new file mode 100644 index 00000000..6e9b3de3 --- /dev/null +++ b/remotes/draft7/subSchemas.json @@ -0,0 +1,10 @@ +{ + "definitions": { + "integer": { + "type": "integer" + }, + "refToInteger": { + "$ref": "#/definitions/integer" + } + } +} diff --git a/tests/draft3/refRemote.json b/tests/draft3/refRemote.json index 0e4ab53e..81a6c511 100644 --- a/tests/draft3/refRemote.json +++ b/tests/draft3/refRemote.json @@ -17,7 +17,7 @@ }, { "description": "fragment within remote ref", - "schema": {"$ref": "http://localhost:1234/subSchemas.json#/definitions/integer"}, + "schema": {"$ref": "http://localhost:1234/draft3/subSchemas.json#/definitions/integer"}, "tests": [ { "description": "remote fragment valid", @@ -34,7 +34,7 @@ { "description": "ref within remote ref", "schema": { - "$ref": "http://localhost:1234/subSchemas.json#/definitions/refToInteger" + "$ref": "http://localhost:1234/draft3/subSchemas.json#/definitions/refToInteger" }, "tests": [ { diff --git a/tests/draft4/refRemote.json b/tests/draft4/refRemote.json index 64a618b8..65e45190 100644 --- a/tests/draft4/refRemote.json +++ b/tests/draft4/refRemote.json @@ -17,7 +17,7 @@ }, { "description": "fragment within remote ref", - "schema": {"$ref": "http://localhost:1234/subSchemas.json#/definitions/integer"}, + "schema": {"$ref": "http://localhost:1234/draft4/subSchemas.json#/definitions/integer"}, "tests": [ { "description": "remote fragment valid", @@ -34,7 +34,7 @@ { "description": "ref within remote ref", "schema": { - "$ref": "http://localhost:1234/subSchemas.json#/definitions/refToInteger" + "$ref": "http://localhost:1234/draft4/subSchemas.json#/definitions/refToInteger" }, "tests": [ { @@ -139,7 +139,7 @@ "id": "http://localhost:1234/object", "type": "object", "properties": { - "name": {"$ref": "name.json#/definitions/orNull"} + "name": {"$ref": "draft4/name.json#/definitions/orNull"} } }, "tests": [ @@ -171,7 +171,7 @@ { "description": "Location-independent identifier in remote ref", "schema": { - "$ref": "http://localhost:1234/locationIndependentIdentifierDraft4.json#/definitions/refToInteger" + "$ref": "http://localhost:1234/draft4/locationIndependentIdentifier.json#/definitions/refToInteger" }, "tests": [ { diff --git a/tests/draft6/refRemote.json b/tests/draft6/refRemote.json index 28459c4a..49ead6d1 100644 --- a/tests/draft6/refRemote.json +++ b/tests/draft6/refRemote.json @@ -17,7 +17,7 @@ }, { "description": "fragment within remote ref", - "schema": {"$ref": "http://localhost:1234/subSchemas.json#/definitions/integer"}, + "schema": {"$ref": "http://localhost:1234/draft6/subSchemas.json#/definitions/integer"}, "tests": [ { "description": "remote fragment valid", @@ -34,7 +34,7 @@ { "description": "ref within remote ref", "schema": { - "$ref": "http://localhost:1234/subSchemas.json#/definitions/refToInteger" + "$ref": "http://localhost:1234/draft6/subSchemas.json#/definitions/refToInteger" }, "tests": [ { @@ -139,7 +139,7 @@ "$id": "http://localhost:1234/object", "type": "object", "properties": { - "name": {"$ref": "name.json#/definitions/orNull"} + "name": {"$ref": "draft6/name.json#/definitions/orNull"} } }, "tests": [ @@ -173,7 +173,7 @@ "schema": { "$id": "http://localhost:1234/schema-remote-ref-ref-defs1.json", "allOf": [ - { "$ref": "ref-and-definitions.json" } + { "$ref": "draft6/ref-and-definitions.json" } ] }, "tests": [ @@ -196,7 +196,7 @@ { "description": "Location-independent identifier in remote ref", "schema": { - "$ref": "http://localhost:1234/locationIndependentIdentifierPre2019.json#/definitions/refToInteger" + "$ref": "http://localhost:1234/draft6/locationIndependentIdentifier.json#/definitions/refToInteger" }, "tests": [ { diff --git a/tests/draft7/refRemote.json b/tests/draft7/refRemote.json index 22185d67..450787af 100644 --- a/tests/draft7/refRemote.json +++ b/tests/draft7/refRemote.json @@ -17,7 +17,7 @@ }, { "description": "fragment within remote ref", - "schema": {"$ref": "http://localhost:1234/subSchemas.json#/definitions/integer"}, + "schema": {"$ref": "http://localhost:1234/draft7/subSchemas.json#/definitions/integer"}, "tests": [ { "description": "remote fragment valid", @@ -34,7 +34,7 @@ { "description": "ref within remote ref", "schema": { - "$ref": "http://localhost:1234/subSchemas.json#/definitions/refToInteger" + "$ref": "http://localhost:1234/draft7/subSchemas.json#/definitions/refToInteger" }, "tests": [ { @@ -139,7 +139,7 @@ "$id": "http://localhost:1234/object", "type": "object", "properties": { - "name": {"$ref": "name.json#/definitions/orNull"} + "name": {"$ref": "draft7/name.json#/definitions/orNull"} } }, "tests": [ @@ -173,7 +173,7 @@ "schema": { "$id": "http://localhost:1234/schema-remote-ref-ref-defs1.json", "allOf": [ - { "$ref": "ref-and-definitions.json" } + { "$ref": "draft7/ref-and-definitions.json" } ] }, "tests": [ @@ -196,7 +196,7 @@ { "description": "Location-independent identifier in remote ref", "schema": { - "$ref": "http://localhost:1234/locationIndependentIdentifierPre2019.json#/definitions/refToInteger" + "$ref": "http://localhost:1234/draft7/locationIndependentIdentifier.json#/definitions/refToInteger" }, "tests": [ {