summaryrefslogtreecommitdiff
path: root/json/tests/draft7/ref.json
diff options
context:
space:
mode:
Diffstat (limited to 'json/tests/draft7/ref.json')
-rw-r--r--json/tests/draft7/ref.json85
1 files changed, 85 insertions, 0 deletions
diff --git a/json/tests/draft7/ref.json b/json/tests/draft7/ref.json
index 2bee83e..8263172 100644
--- a/json/tests/draft7/ref.json
+++ b/json/tests/draft7/ref.json
@@ -927,5 +927,90 @@
"valid": false
}
]
+ },
+ {
+ "description": "$id with file URI still resolves pointers - *nix",
+ "schema": {
+ "$id": "file:///folder/file.json",
+ "definitions": {
+ "foo": {
+ "type": "number"
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/definitions/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",
+ "definitions": {
+ "foo": {
+ "type": "number"
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/definitions/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": {
+ "definitions": {
+ "": {
+ "definitions": {
+ "": { "type": "number" }
+ }
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/definitions//definitions/"
+ }
+ ]
+ },
+ "tests": [
+ {
+ "description": "number is valid",
+ "data": 1,
+ "valid": true
+ },
+ {
+ "description": "non-number is invalid",
+ "data": "a",
+ "valid": false
+ }
+ ]
}
]