summaryrefslogtreecommitdiff
path: root/tests/draft6/ref.json
diff options
context:
space:
mode:
Diffstat (limited to 'tests/draft6/ref.json')
-rw-r--r--tests/draft6/ref.json85
1 files changed, 85 insertions, 0 deletions
diff --git a/tests/draft6/ref.json b/tests/draft6/ref.json
index 8a36593..8a8908a 100644
--- a/tests/draft6/ref.json
+++ b/tests/draft6/ref.json
@@ -813,5 +813,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
+ }
+ ]
}
]