summaryrefslogtreecommitdiff
path: root/json
diff options
context:
space:
mode:
authorJulian Berman <Julian@GrayVines.com>2022-07-31 08:50:45 +0300
committerJulian Berman <Julian@GrayVines.com>2022-07-31 08:50:45 +0300
commit5bdcaaa3c562ab3f198ad18d04e9525bb3dc8c55 (patch)
tree61474728c78b1aee006a2349b600e1297e4b795e /json
parentd2181bb1570b9969e58c4ce948054b38a529254f (diff)
parentecc464314583f989ca4f3d9da87d60543b8b5189 (diff)
downloadjsonschema-5bdcaaa3c562ab3f198ad18d04e9525bb3dc8c55.tar.gz
Merge commit 'ecc464314583f989ca4f3d9da87d60543b8b5189'
* commit 'ecc464314583f989ca4f3d9da87d60543b8b5189': Squashed 'json/' changes from fd9bcfbdb..685ac631d
Diffstat (limited to 'json')
-rw-r--r--json/tests/draft-next/ref.json188
-rw-r--r--json/tests/draft2019-09/ref.json188
-rw-r--r--json/tests/draft2020-12/ref.json188
-rw-r--r--json/tests/draft6/ref.json174
-rw-r--r--json/tests/draft7/ref.json174
5 files changed, 912 insertions, 0 deletions
diff --git a/json/tests/draft-next/ref.json b/json/tests/draft-next/ref.json
index 421b5f8..f2b5fc0 100644
--- a/json/tests/draft-next/ref.json
+++ b/json/tests/draft-next/ref.json
@@ -642,5 +642,193 @@
"valid": false
}
]
+ },
+ {
+ "description": "simple URN base URI with $ref via the URN",
+ "schema": {
+ "$comment": "URIs do not have to have HTTP(s) schemes",
+ "$id": "urn:uuid:deadbeef-1234-ffff-ffff-4321feebdaed",
+ "minimum": 30,
+ "properties": {
+ "foo": {"$ref": "urn:uuid:deadbeef-1234-ffff-ffff-4321feebdaed"}
+ }
+ },
+ "tests": [
+ {
+ "description": "valid under the URN IDed schema",
+ "data": {"foo": 37},
+ "valid": true
+ },
+ {
+ "description": "invalid under the URN IDed schema",
+ "data": {"foo": 12},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "simple URN base URI with JSON pointer",
+ "schema": {
+ "$comment": "URIs do not have to have HTTP(s) schemes",
+ "$id": "urn:uuid:deadbeef-1234-ffff-ffff-4321feebdaed",
+ "properties": {
+ "foo": {"$ref": "#/$defs/bar"}
+ },
+ "$defs": {
+ "bar": {"type": "string"}
+ }
+ },
+ "tests": [
+ {
+ "description": "a string is valid",
+ "data": {"foo": "bar"},
+ "valid": true
+ },
+ {
+ "description": "a non-string is invalid",
+ "data": {"foo": 12},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "URN base URI with NSS",
+ "schema": {
+ "$comment": "RFC 8141 §2.2",
+ "$id": "urn:example:1/406/47452/2",
+ "properties": {
+ "foo": {"$ref": "#/$defs/bar"}
+ },
+ "$defs": {
+ "bar": {"type": "string"}
+ }
+ },
+ "tests": [
+ {
+ "description": "a string is valid",
+ "data": {"foo": "bar"},
+ "valid": true
+ },
+ {
+ "description": "a non-string is invalid",
+ "data": {"foo": 12},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "URN base URI with r-component",
+ "schema": {
+ "$comment": "RFC 8141 §2.3.1",
+ "$id": "urn:example:foo-bar-baz-qux?+CCResolve:cc=uk",
+ "properties": {
+ "foo": {"$ref": "#/$defs/bar"}
+ },
+ "$defs": {
+ "bar": {"type": "string"}
+ }
+ },
+ "tests": [
+ {
+ "description": "a string is valid",
+ "data": {"foo": "bar"},
+ "valid": true
+ },
+ {
+ "description": "a non-string is invalid",
+ "data": {"foo": 12},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "URN base URI with q-component",
+ "schema": {
+ "$comment": "RFC 8141 §2.3.2",
+ "$id": "urn:example:weather?=op=map&lat=39.56&lon=-104.85&datetime=1969-07-21T02:56:15Z",
+ "properties": {
+ "foo": {"$ref": "#/$defs/bar"}
+ },
+ "$defs": {
+ "bar": {"type": "string"}
+ }
+ },
+ "tests": [
+ {
+ "description": "a string is valid",
+ "data": {"foo": "bar"},
+ "valid": true
+ },
+ {
+ "description": "a non-string is invalid",
+ "data": {"foo": 12},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "URN base URI with f-component",
+ "schema": {
+ "$comment": "RFC 8141 §2.3.3, but we don't allow fragments",
+ "$ref": "https://json-schema.org/draft/next/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": {
+ "$id": "urn:uuid:deadbeef-1234-0000-0000-4321feebdaed",
+ "properties": {
+ "foo": {"$ref": "urn:uuid:deadbeef-1234-0000-0000-4321feebdaed#/$defs/bar"}
+ },
+ "$defs": {
+ "bar": {"type": "string"}
+ }
+ },
+ "tests": [
+ {
+ "description": "a string is valid",
+ "data": {"foo": "bar"},
+ "valid": true
+ },
+ {
+ "description": "a non-string is invalid",
+ "data": {"foo": 12},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "URN base URI with URN and anchor ref",
+ "schema": {
+ "$id": "urn:uuid:deadbeef-1234-0000-0000-4321feebdaed",
+ "properties": {
+ "foo": {"$ref": "urn:uuid:deadbeef-1234-0000-0000-4321feebdaed#something"}
+ },
+ "$defs": {
+ "bar": {
+ "$anchor": "something",
+ "type": "string"
+ }
+ }
+ },
+ "tests": [
+ {
+ "description": "a string is valid",
+ "data": {"foo": "bar"},
+ "valid": true
+ },
+ {
+ "description": "a non-string is invalid",
+ "data": {"foo": 12},
+ "valid": false
+ }
+ ]
}
]
diff --git a/json/tests/draft2019-09/ref.json b/json/tests/draft2019-09/ref.json
index 55a447c..32e3c66 100644
--- a/json/tests/draft2019-09/ref.json
+++ b/json/tests/draft2019-09/ref.json
@@ -642,5 +642,193 @@
"valid": false
}
]
+ },
+ {
+ "description": "simple URN base URI with $ref via the URN",
+ "schema": {
+ "$comment": "URIs do not have to have HTTP(s) schemes",
+ "$id": "urn:uuid:deadbeef-1234-ffff-ffff-4321feebdaed",
+ "minimum": 30,
+ "properties": {
+ "foo": {"$ref": "urn:uuid:deadbeef-1234-ffff-ffff-4321feebdaed"}
+ }
+ },
+ "tests": [
+ {
+ "description": "valid under the URN IDed schema",
+ "data": {"foo": 37},
+ "valid": true
+ },
+ {
+ "description": "invalid under the URN IDed schema",
+ "data": {"foo": 12},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "simple URN base URI with JSON pointer",
+ "schema": {
+ "$comment": "URIs do not have to have HTTP(s) schemes",
+ "$id": "urn:uuid:deadbeef-1234-00ff-ff00-4321feebdaed",
+ "properties": {
+ "foo": {"$ref": "#/$defs/bar"}
+ },
+ "$defs": {
+ "bar": {"type": "string"}
+ }
+ },
+ "tests": [
+ {
+ "description": "a string is valid",
+ "data": {"foo": "bar"},
+ "valid": true
+ },
+ {
+ "description": "a non-string is invalid",
+ "data": {"foo": 12},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "URN base URI with NSS",
+ "schema": {
+ "$comment": "RFC 8141 §2.2",
+ "$id": "urn:example:1/406/47452/2",
+ "properties": {
+ "foo": {"$ref": "#/$defs/bar"}
+ },
+ "$defs": {
+ "bar": {"type": "string"}
+ }
+ },
+ "tests": [
+ {
+ "description": "a string is valid",
+ "data": {"foo": "bar"},
+ "valid": true
+ },
+ {
+ "description": "a non-string is invalid",
+ "data": {"foo": 12},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "URN base URI with r-component",
+ "schema": {
+ "$comment": "RFC 8141 §2.3.1",
+ "$id": "urn:example:foo-bar-baz-qux?+CCResolve:cc=uk",
+ "properties": {
+ "foo": {"$ref": "#/$defs/bar"}
+ },
+ "$defs": {
+ "bar": {"type": "string"}
+ }
+ },
+ "tests": [
+ {
+ "description": "a string is valid",
+ "data": {"foo": "bar"},
+ "valid": true
+ },
+ {
+ "description": "a non-string is invalid",
+ "data": {"foo": 12},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "URN base URI with q-component",
+ "schema": {
+ "$comment": "RFC 8141 §2.3.2",
+ "$id": "urn:example:weather?=op=map&lat=39.56&lon=-104.85&datetime=1969-07-21T02:56:15Z",
+ "properties": {
+ "foo": {"$ref": "#/$defs/bar"}
+ },
+ "$defs": {
+ "bar": {"type": "string"}
+ }
+ },
+ "tests": [
+ {
+ "description": "a string is valid",
+ "data": {"foo": "bar"},
+ "valid": true
+ },
+ {
+ "description": "a non-string is invalid",
+ "data": {"foo": 12},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "URN base URI with f-component",
+ "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": {
+ "$id": "urn:uuid:deadbeef-1234-0000-0000-4321feebdaed",
+ "properties": {
+ "foo": {"$ref": "urn:uuid:deadbeef-1234-0000-0000-4321feebdaed#/$defs/bar"}
+ },
+ "$defs": {
+ "bar": {"type": "string"}
+ }
+ },
+ "tests": [
+ {
+ "description": "a string is valid",
+ "data": {"foo": "bar"},
+ "valid": true
+ },
+ {
+ "description": "a non-string is invalid",
+ "data": {"foo": 12},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "URN base URI with URN and anchor ref",
+ "schema": {
+ "$id": "urn:uuid:deadbeef-1234-ff00-00ff-4321feebdaed",
+ "properties": {
+ "foo": {"$ref": "urn:uuid:deadbeef-1234-ff00-00ff-4321feebdaed#something"}
+ },
+ "$defs": {
+ "bar": {
+ "$anchor": "something",
+ "type": "string"
+ }
+ }
+ },
+ "tests": [
+ {
+ "description": "a string is valid",
+ "data": {"foo": "bar"},
+ "valid": true
+ },
+ {
+ "description": "a non-string is invalid",
+ "data": {"foo": 12},
+ "valid": false
+ }
+ ]
}
]
diff --git a/json/tests/draft2020-12/ref.json b/json/tests/draft2020-12/ref.json
index 122ff75..bc8ac44 100644
--- a/json/tests/draft2020-12/ref.json
+++ b/json/tests/draft2020-12/ref.json
@@ -642,5 +642,193 @@
"valid": false
}
]
+ },
+ {
+ "description": "simple URN base URI with $ref via the URN",
+ "schema": {
+ "$comment": "URIs do not have to have HTTP(s) schemes",
+ "$id": "urn:uuid:deadbeef-1234-ffff-ffff-4321feebdaed",
+ "minimum": 30,
+ "properties": {
+ "foo": {"$ref": "urn:uuid:deadbeef-1234-ffff-ffff-4321feebdaed"}
+ }
+ },
+ "tests": [
+ {
+ "description": "valid under the URN IDed schema",
+ "data": {"foo": 37},
+ "valid": true
+ },
+ {
+ "description": "invalid under the URN IDed schema",
+ "data": {"foo": 12},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "simple URN base URI with JSON pointer",
+ "schema": {
+ "$comment": "URIs do not have to have HTTP(s) schemes",
+ "$id": "urn:uuid:deadbeef-1234-00ff-ff00-4321feebdaed",
+ "properties": {
+ "foo": {"$ref": "#/$defs/bar"}
+ },
+ "$defs": {
+ "bar": {"type": "string"}
+ }
+ },
+ "tests": [
+ {
+ "description": "a string is valid",
+ "data": {"foo": "bar"},
+ "valid": true
+ },
+ {
+ "description": "a non-string is invalid",
+ "data": {"foo": 12},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "URN base URI with NSS",
+ "schema": {
+ "$comment": "RFC 8141 §2.2",
+ "$id": "urn:example:1/406/47452/2",
+ "properties": {
+ "foo": {"$ref": "#/$defs/bar"}
+ },
+ "$defs": {
+ "bar": {"type": "string"}
+ }
+ },
+ "tests": [
+ {
+ "description": "a string is valid",
+ "data": {"foo": "bar"},
+ "valid": true
+ },
+ {
+ "description": "a non-string is invalid",
+ "data": {"foo": 12},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "URN base URI with r-component",
+ "schema": {
+ "$comment": "RFC 8141 §2.3.1",
+ "$id": "urn:example:foo-bar-baz-qux?+CCResolve:cc=uk",
+ "properties": {
+ "foo": {"$ref": "#/$defs/bar"}
+ },
+ "$defs": {
+ "bar": {"type": "string"}
+ }
+ },
+ "tests": [
+ {
+ "description": "a string is valid",
+ "data": {"foo": "bar"},
+ "valid": true
+ },
+ {
+ "description": "a non-string is invalid",
+ "data": {"foo": 12},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "URN base URI with q-component",
+ "schema": {
+ "$comment": "RFC 8141 §2.3.2",
+ "$id": "urn:example:weather?=op=map&lat=39.56&lon=-104.85&datetime=1969-07-21T02:56:15Z",
+ "properties": {
+ "foo": {"$ref": "#/$defs/bar"}
+ },
+ "$defs": {
+ "bar": {"type": "string"}
+ }
+ },
+ "tests": [
+ {
+ "description": "a string is valid",
+ "data": {"foo": "bar"},
+ "valid": true
+ },
+ {
+ "description": "a non-string is invalid",
+ "data": {"foo": 12},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "URN base URI with f-component",
+ "schema": {
+ "$comment": "RFC 8141 §2.3.3, but we don't allow fragments",
+ "$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": {
+ "$id": "urn:uuid:deadbeef-1234-0000-0000-4321feebdaed",
+ "properties": {
+ "foo": {"$ref": "urn:uuid:deadbeef-1234-0000-0000-4321feebdaed#/$defs/bar"}
+ },
+ "$defs": {
+ "bar": {"type": "string"}
+ }
+ },
+ "tests": [
+ {
+ "description": "a string is valid",
+ "data": {"foo": "bar"},
+ "valid": true
+ },
+ {
+ "description": "a non-string is invalid",
+ "data": {"foo": 12},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "URN base URI with URN and anchor ref",
+ "schema": {
+ "$id": "urn:uuid:deadbeef-1234-ff00-00ff-4321feebdaed",
+ "properties": {
+ "foo": {"$ref": "urn:uuid:deadbeef-1234-ff00-00ff-4321feebdaed#something"}
+ },
+ "$defs": {
+ "bar": {
+ "$anchor": "something",
+ "type": "string"
+ }
+ }
+ },
+ "tests": [
+ {
+ "description": "a string is valid",
+ "data": {"foo": "bar"},
+ "valid": true
+ },
+ {
+ "description": "a non-string is invalid",
+ "data": {"foo": 12},
+ "valid": false
+ }
+ ]
}
]
diff --git a/json/tests/draft6/ref.json b/json/tests/draft6/ref.json
index ce5caf6..3e72a59 100644
--- a/json/tests/draft6/ref.json
+++ b/json/tests/draft6/ref.json
@@ -608,5 +608,179 @@
"valid": true
}
]
+ },
+ {
+ "description": "simple URN base URI with $ref via the URN",
+ "schema": {
+ "$comment": "URIs do not have to have HTTP(s) schemes",
+ "$id": "urn:uuid:deadbeef-1234-ffff-ffff-4321feebdaed",
+ "minimum": 30,
+ "properties": {
+ "foo": {"$ref": "urn:uuid:deadbeef-1234-ffff-ffff-4321feebdaed"}
+ }
+ },
+ "tests": [
+ {
+ "description": "valid under the URN IDed schema",
+ "data": {"foo": 37},
+ "valid": true
+ },
+ {
+ "description": "invalid under the URN IDed schema",
+ "data": {"foo": 12},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "simple URN base URI with JSON pointer",
+ "schema": {
+ "$comment": "URIs do not have to have HTTP(s) schemes",
+ "$id": "urn:uuid:deadbeef-1234-00ff-ff00-4321feebdaed",
+ "properties": {
+ "foo": {"$ref": "#/definitions/bar"}
+ },
+ "definitions": {
+ "bar": {"type": "string"}
+ }
+ },
+ "tests": [
+ {
+ "description": "a string is valid",
+ "data": {"foo": "bar"},
+ "valid": true
+ },
+ {
+ "description": "a non-string is invalid",
+ "data": {"foo": 12},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "URN base URI with NSS",
+ "schema": {
+ "$comment": "RFC 8141 §2.2",
+ "$id": "urn:example:1/406/47452/2",
+ "properties": {
+ "foo": {"$ref": "#/definitions/bar"}
+ },
+ "definitions": {
+ "bar": {"type": "string"}
+ }
+ },
+ "tests": [
+ {
+ "description": "a string is valid",
+ "data": {"foo": "bar"},
+ "valid": true
+ },
+ {
+ "description": "a non-string is invalid",
+ "data": {"foo": 12},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "URN base URI with r-component",
+ "schema": {
+ "$comment": "RFC 8141 §2.3.1",
+ "$id": "urn:example:foo-bar-baz-qux?+CCResolve:cc=uk",
+ "properties": {
+ "foo": {"$ref": "#/definitions/bar"}
+ },
+ "definitions": {
+ "bar": {"type": "string"}
+ }
+ },
+ "tests": [
+ {
+ "description": "a string is valid",
+ "data": {"foo": "bar"},
+ "valid": true
+ },
+ {
+ "description": "a non-string is invalid",
+ "data": {"foo": 12},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "URN base URI with q-component",
+ "schema": {
+ "$comment": "RFC 8141 §2.3.2",
+ "$id": "urn:example:weather?=op=map&lat=39.56&lon=-104.85&datetime=1969-07-21T02:56:15Z",
+ "properties": {
+ "foo": {"$ref": "#/definitions/bar"}
+ },
+ "definitions": {
+ "bar": {"type": "string"}
+ }
+ },
+ "tests": [
+ {
+ "description": "a string is valid",
+ "data": {"foo": "bar"},
+ "valid": true
+ },
+ {
+ "description": "a non-string is invalid",
+ "data": {"foo": 12},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "URN base URI with URN and JSON pointer ref",
+ "schema": {
+ "$id": "urn:uuid:deadbeef-1234-0000-0000-4321feebdaed",
+ "properties": {
+ "foo": {"$ref": "urn:uuid:deadbeef-1234-0000-0000-4321feebdaed#/$defs/bar"}
+ },
+ "$defs": {
+ "bar": {"type": "string"}
+ }
+ },
+ "tests": [
+ {
+ "description": "a string is valid",
+ "data": {"foo": "bar"},
+ "valid": true
+ },
+ {
+ "description": "a non-string is invalid",
+ "data": {"foo": 12},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "URN base URI with URN and anchor ref",
+ "schema": {
+ "$id": "urn:uuid:deadbeef-1234-ff00-00ff-4321feebdaed",
+ "properties": {
+ "foo": {"$ref": "urn:uuid:deadbeef-1234-ff00-00ff-4321feebdaed#something"}
+ },
+ "$defs": {
+ "bar": {
+ "$id": "#something",
+ "type": "string"
+ }
+ }
+ },
+ "tests": [
+ {
+ "description": "a string is valid",
+ "data": {"foo": "bar"},
+ "valid": true
+ },
+ {
+ "description": "a non-string is invalid",
+ "data": {"foo": 12},
+ "valid": false
+ }
+ ]
}
]
diff --git a/json/tests/draft7/ref.json b/json/tests/draft7/ref.json
index 764d637..52e5168 100644
--- a/json/tests/draft7/ref.json
+++ b/json/tests/draft7/ref.json
@@ -644,5 +644,179 @@
"valid": false
}
]
+ },
+ {
+ "description": "simple URN base URI with $ref via the URN",
+ "schema": {
+ "$comment": "URIs do not have to have HTTP(s) schemes",
+ "$id": "urn:uuid:deadbeef-1234-ffff-ffff-4321feebdaed",
+ "minimum": 30,
+ "properties": {
+ "foo": {"$ref": "urn:uuid:deadbeef-1234-ffff-ffff-4321feebdaed"}
+ }
+ },
+ "tests": [
+ {
+ "description": "valid under the URN IDed schema",
+ "data": {"foo": 37},
+ "valid": true
+ },
+ {
+ "description": "invalid under the URN IDed schema",
+ "data": {"foo": 12},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "simple URN base URI with JSON pointer",
+ "schema": {
+ "$comment": "URIs do not have to have HTTP(s) schemes",
+ "$id": "urn:uuid:deadbeef-1234-00ff-ff00-4321feebdaed",
+ "properties": {
+ "foo": {"$ref": "#/definitions/bar"}
+ },
+ "definitions": {
+ "bar": {"type": "string"}
+ }
+ },
+ "tests": [
+ {
+ "description": "a string is valid",
+ "data": {"foo": "bar"},
+ "valid": true
+ },
+ {
+ "description": "a non-string is invalid",
+ "data": {"foo": 12},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "URN base URI with NSS",
+ "schema": {
+ "$comment": "RFC 8141 §2.2",
+ "$id": "urn:example:1/406/47452/2",
+ "properties": {
+ "foo": {"$ref": "#/definitions/bar"}
+ },
+ "definitions": {
+ "bar": {"type": "string"}
+ }
+ },
+ "tests": [
+ {
+ "description": "a string is valid",
+ "data": {"foo": "bar"},
+ "valid": true
+ },
+ {
+ "description": "a non-string is invalid",
+ "data": {"foo": 12},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "URN base URI with r-component",
+ "schema": {
+ "$comment": "RFC 8141 §2.3.1",
+ "$id": "urn:example:foo-bar-baz-qux?+CCResolve:cc=uk",
+ "properties": {
+ "foo": {"$ref": "#/definitions/bar"}
+ },
+ "definitions": {
+ "bar": {"type": "string"}
+ }
+ },
+ "tests": [
+ {
+ "description": "a string is valid",
+ "data": {"foo": "bar"},
+ "valid": true
+ },
+ {
+ "description": "a non-string is invalid",
+ "data": {"foo": 12},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "URN base URI with q-component",
+ "schema": {
+ "$comment": "RFC 8141 §2.3.2",
+ "$id": "urn:example:weather?=op=map&lat=39.56&lon=-104.85&datetime=1969-07-21T02:56:15Z",
+ "properties": {
+ "foo": {"$ref": "#/definitions/bar"}
+ },
+ "definitions": {
+ "bar": {"type": "string"}
+ }
+ },
+ "tests": [
+ {
+ "description": "a string is valid",
+ "data": {"foo": "bar"},
+ "valid": true
+ },
+ {
+ "description": "a non-string is invalid",
+ "data": {"foo": 12},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "URN base URI with URN and JSON pointer ref",
+ "schema": {
+ "$id": "urn:uuid:deadbeef-1234-0000-0000-4321feebdaed",
+ "properties": {
+ "foo": {"$ref": "urn:uuid:deadbeef-1234-0000-0000-4321feebdaed#/$defs/bar"}
+ },
+ "$defs": {
+ "bar": {"type": "string"}
+ }
+ },
+ "tests": [
+ {
+ "description": "a string is valid",
+ "data": {"foo": "bar"},
+ "valid": true
+ },
+ {
+ "description": "a non-string is invalid",
+ "data": {"foo": 12},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "URN base URI with URN and anchor ref",
+ "schema": {
+ "$id": "urn:uuid:deadbeef-1234-ff00-00ff-4321feebdaed",
+ "properties": {
+ "foo": {"$ref": "urn:uuid:deadbeef-1234-ff00-00ff-4321feebdaed#something"}
+ },
+ "$defs": {
+ "bar": {
+ "$id": "#something",
+ "type": "string"
+ }
+ }
+ },
+ "tests": [
+ {
+ "description": "a string is valid",
+ "data": {"foo": "bar"},
+ "valid": true
+ },
+ {
+ "description": "a non-string is invalid",
+ "data": {"foo": 12},
+ "valid": false
+ }
+ ]
}
]