Skip to content

Commit 12b4a4c

Browse files
jgraettingerJulian
authored andcommitted
add optional test for $ref of an unknown keyword
1 parent a863dba commit 12b4a4c

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
[
2+
{
3+
"description": "reference of a root arbitrary keyword ",
4+
"schema": {
5+
"unknown-keyword": {"type": "integer"},
6+
"properties": {
7+
"bar": {"$ref": "#/unknown-keyword"}
8+
}
9+
},
10+
"tests": [
11+
{
12+
"description": "match",
13+
"data": {"bar": 3},
14+
"valid": true
15+
},
16+
{
17+
"description": "mismatch",
18+
"data": {"bar": true},
19+
"valid": false
20+
}
21+
]
22+
},
23+
{
24+
"description": "reference of an arbitrary keyword of a sub-schema",
25+
"schema": {
26+
"properties": {
27+
"foo": {"unknown-keyword": {"type": "integer"}},
28+
"bar": {"$ref": "#/properties/foo/unknown-keyword"}
29+
}
30+
},
31+
"tests": [
32+
{
33+
"description": "match",
34+
"data": {"bar": 3},
35+
"valid": true
36+
},
37+
{
38+
"description": "mismatch",
39+
"data": {"bar": true},
40+
"valid": false
41+
}
42+
]
43+
}
44+
]

0 commit comments

Comments
 (0)