summaryrefslogtreecommitdiff
path: root/tests/draft3/ref.json
diff options
context:
space:
mode:
Diffstat (limited to 'tests/draft3/ref.json')
-rw-r--r--tests/draft3/ref.json36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/draft3/ref.json b/tests/draft3/ref.json
index 26dcb52..760b771 100644
--- a/tests/draft3/ref.json
+++ b/tests/draft3/ref.json
@@ -201,6 +201,42 @@
]
},
{
+ "description": "$ref prevents a sibling $id from changing the base uri",
+ "schema": {
+ "$id": "http://localhost:1234/sibling_id/base/",
+ "definitions": {
+ "foo": {
+ "$id": "http://localhost:1234/sibling_id/foo.json",
+ "minimum": 2
+ },
+ "base_foo": {
+ "$comment": "this canonical uri is http://localhost:1234/sibling_id/base/foo.json",
+ "$id": "foo.json",
+ "minimum": 5
+ }
+ },
+ "allOf": [
+ {
+ "$comment": "$ref resolves to http://localhost:1234/sibling_id/base/foo.json, not ttp://localhost:1234/sibling_id/foo.json",
+ "$id": "http://localhost:1234/sibling_id/",
+ "$ref": "foo.json"
+ }
+ ]
+ },
+ "tests": [
+ {
+ "description": "$ref resolves to /definitions/foo, data validates",
+ "data": 10,
+ "valid": true
+ },
+ {
+ "description": "$ref resolves to /definitions/foo, data does not validate",
+ "data": 1,
+ "valid": false
+ }
+ ]
+ },
+ {
"description": "remote ref, containing refs itself",
"schema": {"$ref": "http://json-schema.org/draft-03/schema#"},
"tests": [