Skip to content

Commit c23c720

Browse files
committed
Merge branch 'ether/unrecognized-keywords'
* ether/unrecognized-keywords: Move the future keywords tests to optional. squash: add $schema keyword to be clear that strict conformance is requested squash: contains does not exist in draft4 squash: fix minContains sq - add $dynamic*, prefixItems to drafts 4,6,7 as well and fix keyword name squash: fix test names squash: $defs - definitions squash: remove tests of $anchor and $ref squash: add prefixItems: another new 2020-0X keyword squash: add $recursiveRef tests from #391 squash - fix 2019-09 future-keywords very basic test of $dynamicRef rename files to future-keywords.json some tests for keywords added in later drafts
2 parents e42e841 + ea68a4f commit c23c720

File tree

4 files changed

+1518
-0
lines changed

4 files changed

+1518
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
[
2+
{
3+
"description": "$dynamicRef without $dynamicAnchor works like $ref",
4+
"schema": {
5+
"$schema": "https://json-schema.org/draft/2019-09/schema",
6+
"properties": {
7+
"foo": {"$dynamicRef": "#"}
8+
},
9+
"additionalProperties": false
10+
},
11+
"tests": [
12+
{
13+
"description": "match",
14+
"data": {"foo": false},
15+
"valid": true
16+
},
17+
{
18+
"description": "recursive match",
19+
"data": {"foo": {"foo": false}},
20+
"valid": true
21+
},
22+
{
23+
"description": "mismatch",
24+
"data": {"bar": false},
25+
"valid": false
26+
},
27+
{
28+
"description": "recursive mismatch (but $dynamicRef is ignored)",
29+
"data": {"foo": {"bar": false}},
30+
"valid": true
31+
}
32+
]
33+
},
34+
{
35+
"description": "prefixItems: an array of schemas for items",
36+
"schema": {
37+
"$schema": "https://json-schema.org/draft/2019-09/schema",
38+
"prefixItems": [
39+
{"type": "integer"},
40+
{"type": "string"}
41+
]
42+
},
43+
"tests": [
44+
{
45+
"description": "correct types",
46+
"data": [ 1, "foo" ],
47+
"valid": true
48+
},
49+
{
50+
"description": "wrong types",
51+
"data": [ "foo", 1 ],
52+
"valid": true
53+
},
54+
{
55+
"description": "incomplete array of items",
56+
"data": [ 1 ],
57+
"valid": true
58+
},
59+
{
60+
"description": "array with additional items",
61+
"data": [ 1, "foo", true ],
62+
"valid": true
63+
},
64+
{
65+
"description": "empty array",
66+
"data": [ ],
67+
"valid": true
68+
},
69+
{
70+
"description": "JavaScript pseudo-array is valid",
71+
"data": {
72+
"0": "invalid",
73+
"1": "valid",
74+
"length": 2
75+
},
76+
"valid": true
77+
}
78+
]
79+
}
80+
]

0 commit comments

Comments
 (0)