summaryrefslogtreecommitdiff
path: root/json/tests/draft2019-09/ref.json
diff options
context:
space:
mode:
Diffstat (limited to 'json/tests/draft2019-09/ref.json')
-rw-r--r--json/tests/draft2019-09/ref.json89
1 files changed, 83 insertions, 6 deletions
diff --git a/json/tests/draft2019-09/ref.json b/json/tests/draft2019-09/ref.json
index d420bd9..7d85041 100644
--- a/json/tests/draft2019-09/ref.json
+++ b/json/tests/draft2019-09/ref.json
@@ -601,16 +601,16 @@
"schema": {
"$schema": "https://json-schema.org/draft/2019-09/schema",
"$comment": "$id must be evaluated before $ref to get the proper $ref destination",
- "$id": "/draft2019-09/ref-and-id1/base.json",
+ "$id": "https://example.com/draft2019-09/ref-and-id1/base.json",
"$ref": "int.json",
"$defs": {
"bigint": {
- "$comment": "canonical uri: /draft2019-09/ref-and-id1/int.json",
+ "$comment": "canonical uri: https://example.com/draft2019-09/ref-and-id1/int.json",
"$id": "int.json",
"maximum": 10
},
"smallint": {
- "$comment": "canonical uri: /draft2019-09/ref-and-id1-int.json",
+ "$comment": "canonical uri: https://example.com/draft2019-09/ref-and-id1-int.json",
"$id": "/draft2019-09/ref-and-id1-int.json",
"maximum": 2
}
@@ -634,16 +634,16 @@
"schema": {
"$schema": "https://json-schema.org/draft/2019-09/schema",
"$comment": "$id must be evaluated before $ref to get the proper $ref destination",
- "$id": "/draft2019-09/ref-and-id2/base.json",
+ "$id": "https://example.com/draft2019-09/ref-and-id2/base.json",
"$ref": "#bigint",
"$defs": {
"bigint": {
- "$comment": "canonical uri: /draft2019-09/ref-and-id2/base.json#/$defs/bigint; another valid uri for this location: /ref-and-id2/base.json#bigint",
+ "$comment": "canonical uri: https://example.com/draft2019-09/ref-and-id2/base.json#/$defs/bigint; another valid uri for this location: https://example.com/ref-and-id2/base.json#bigint",
"$anchor": "bigint",
"maximum": 10
},
"smallint": {
- "$comment": "canonical uri: /draft2019-09/ref-and-id2#/$defs/smallint; another valid uri for this location: /ref-and-id2/#bigint",
+ "$comment": "canonical uri: https://example.com/draft2019-09/ref-and-id2#/$defs/smallint; another valid uri for this location: https://example.com/ref-and-id2/#bigint",
"$id": "/draft2019-09/ref-and-id2/",
"$anchor": "bigint",
"maximum": 2
@@ -978,5 +978,82 @@
"valid": false
}
]
+ },
+ {
+ "description": "$id with file URI still resolves pointers - *nix",
+ "schema": {
+ "$id": "file:///folder/file.json",
+ "$defs": {
+ "foo": {
+ "type": "number"
+ }
+ },
+ "$ref": "#/$defs/foo"
+ },
+ "tests": [
+ {
+ "description": "number is valid",
+ "data": 1,
+ "valid": true
+ },
+ {
+ "description": "non-number is invalid",
+ "data": "a",
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "$id with file URI still resolves pointers - windows",
+ "schema": {
+ "$id": "file:///c:/folder/file.json",
+ "$defs": {
+ "foo": {
+ "type": "number"
+ }
+ },
+ "$ref": "#/$defs/foo"
+ },
+ "tests": [
+ {
+ "description": "number is valid",
+ "data": 1,
+ "valid": true
+ },
+ {
+ "description": "non-number is invalid",
+ "data": "a",
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "empty tokens in $ref json-pointer",
+ "schema": {
+ "$defs": {
+ "": {
+ "$defs": {
+ "": { "type": "number" }
+ }
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/$defs//$defs/"
+ }
+ ]
+ },
+ "tests": [
+ {
+ "description": "number is valid",
+ "data": 1,
+ "valid": true
+ },
+ {
+ "description": "non-number is invalid",
+ "data": "a",
+ "valid": false
+ }
+ ]
}
]