summaryrefslogtreecommitdiff
path: root/json/tests/draft-future/optional/refOfUnknownKeyword.json
diff options
context:
space:
mode:
Diffstat (limited to 'json/tests/draft-future/optional/refOfUnknownKeyword.json')
-rw-r--r--json/tests/draft-future/optional/refOfUnknownKeyword.json44
1 files changed, 44 insertions, 0 deletions
diff --git a/json/tests/draft-future/optional/refOfUnknownKeyword.json b/json/tests/draft-future/optional/refOfUnknownKeyword.json
new file mode 100644
index 0000000..5b150df
--- /dev/null
+++ b/json/tests/draft-future/optional/refOfUnknownKeyword.json
@@ -0,0 +1,44 @@
+[
+ {
+ "description": "reference of a root arbitrary keyword ",
+ "schema": {
+ "unknown-keyword": {"type": "integer"},
+ "properties": {
+ "bar": {"$ref": "#/unknown-keyword"}
+ }
+ },
+ "tests": [
+ {
+ "description": "match",
+ "data": {"bar": 3},
+ "valid": true
+ },
+ {
+ "description": "mismatch",
+ "data": {"bar": true},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "reference of an arbitrary keyword of a sub-schema",
+ "schema": {
+ "properties": {
+ "foo": {"unknown-keyword": {"type": "integer"}},
+ "bar": {"$ref": "#/properties/foo/unknown-keyword"}
+ }
+ },
+ "tests": [
+ {
+ "description": "match",
+ "data": {"bar": 3},
+ "valid": true
+ },
+ {
+ "description": "mismatch",
+ "data": {"bar": true},
+ "valid": false
+ }
+ ]
+ }
+]