summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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
+ }
+ ]
}
]