diff --git a/tests/draft2019-09/ref.json b/tests/draft2019-09/ref.json index 5ab99100..5b0f0931 100644 --- a/tests/draft2019-09/ref.json +++ b/tests/draft2019-09/ref.json @@ -720,6 +720,30 @@ } ] }, + { + "description": "simple custom URI base URI with $ref via the custom URI", + "schema": { + "$comment": "URIs do not have to have HTTP(s) schemes", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "foo:bar/baz", + "minimum": 30, + "properties": { + "foo": {"$ref": "foo:bar/baz"} + } + }, + "tests": [ + { + "description": "valid under the custom URI IDed schema", + "data": {"foo": 37}, + "valid": true + }, + { + "description": "invalid under the custom URI IDed schema", + "data": {"foo": 12}, + "valid": false + } + ] + }, { "description": "simple URN base URI with JSON pointer", "schema": { diff --git a/tests/draft2020-12/ref.json b/tests/draft2020-12/ref.json index 9ca82eeb..9ba8527b 100644 --- a/tests/draft2020-12/ref.json +++ b/tests/draft2020-12/ref.json @@ -720,6 +720,30 @@ } ] }, + { + "description": "simple custom URI base URI with $ref via the custom URI", + "schema": { + "$comment": "URIs do not have to have HTTP(s) schemes", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "foo:bar/baz", + "minimum": 30, + "properties": { + "foo": {"$ref": "foo:bar/baz"} + } + }, + "tests": [ + { + "description": "valid under the custom URI IDed schema", + "data": {"foo": 37}, + "valid": true + }, + { + "description": "invalid under the custom URI IDed schema", + "data": {"foo": 12}, + "valid": false + } + ] + }, { "description": "simple URN base URI with JSON pointer", "schema": { diff --git a/tests/draft6/ref.json b/tests/draft6/ref.json index 379322c7..c7901287 100644 --- a/tests/draft6/ref.json +++ b/tests/draft6/ref.json @@ -659,6 +659,30 @@ } ] }, + { + "description": "simple custom URI base URI with $ref via the custom URI", + "schema": { + "$comment": "URIs do not have to have HTTP(s) schemes", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "foo:bar/baz", + "minimum": 30, + "properties": { + "foo": {"$ref": "foo:bar/baz"} + } + }, + "tests": [ + { + "description": "valid under the custom URI IDed schema", + "data": {"foo": 37}, + "valid": true + }, + { + "description": "invalid under the custom URI IDed schema", + "data": {"foo": 12}, + "valid": false + } + ] + }, { "description": "simple URN base URI with JSON pointer", "schema": { diff --git a/tests/draft7/ref.json b/tests/draft7/ref.json index 82e1e167..e1a75f85 100644 --- a/tests/draft7/ref.json +++ b/tests/draft7/ref.json @@ -695,6 +695,30 @@ } ] }, + { + "description": "simple custom URI base URI with $ref via the custom URI", + "schema": { + "$comment": "URIs do not have to have HTTP(s) schemes", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "foo:bar/baz", + "minimum": 30, + "properties": { + "foo": {"$ref": "foo:bar/baz"} + } + }, + "tests": [ + { + "description": "valid under the custom URI IDed schema", + "data": {"foo": 37}, + "valid": true + }, + { + "description": "invalid under the custom URI IDed schema", + "data": {"foo": 12}, + "valid": false + } + ] + }, { "description": "simple URN base URI with JSON pointer", "schema": { diff --git a/tests/v1/ref.json b/tests/v1/ref.json index e7a36f68..425d71a9 100644 --- a/tests/v1/ref.json +++ b/tests/v1/ref.json @@ -720,6 +720,30 @@ } ] }, + { + "description": "simple custom URI base URI with $ref via the custom URI", + "schema": { + "$comment": "URIs do not have to have HTTP(s) schemes", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "foo:bar/baz", + "minimum": 30, + "properties": { + "foo": {"$ref": "foo:bar/baz"} + } + }, + "tests": [ + { + "description": "valid under the custom URI IDed schema", + "data": {"foo": 37}, + "valid": true + }, + { + "description": "invalid under the custom URI IDed schema", + "data": {"foo": 12}, + "valid": false + } + ] + }, { "description": "simple URN base URI with JSON pointer", "schema": {