Skip to content

Commit 53858ff

Browse files
committed
draft-06: items keyword with boolean schemas
1 parent 77e0411 commit 53858ff

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

tests/draft6/items.json

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,60 @@
5757
"valid": true
5858
}
5959
]
60+
},
61+
{
62+
"description": "items with boolean schema (true)",
63+
"schema": {"items": true},
64+
"tests": [
65+
{
66+
"description": "any array is valid",
67+
"data": [ 1, "foo", true ],
68+
"valid": true
69+
},
70+
{
71+
"description": "empty array is valid",
72+
"data": [],
73+
"valid": true
74+
}
75+
]
76+
},
77+
{
78+
"description": "items with boolean schema (false)",
79+
"schema": {"items": false},
80+
"tests": [
81+
{
82+
"description": "any non-empty array is invalid",
83+
"data": [ 1, "foo", true ],
84+
"valid": false
85+
},
86+
{
87+
"description": "empty array is valid",
88+
"data": [],
89+
"valid": true
90+
}
91+
]
92+
},
93+
{
94+
"description": "items with boolean schemas",
95+
"schema": {
96+
"items": [true, false]
97+
},
98+
"tests": [
99+
{
100+
"description": "array with one item is valid",
101+
"data": [ 1 ],
102+
"valid": true
103+
},
104+
{
105+
"description": "array with two items is invalid",
106+
"data": [ 1, "foo" ],
107+
"valid": false
108+
},
109+
{
110+
"description": "empty array is valid",
111+
"data": [],
112+
"valid": true
113+
}
114+
]
60115
}
61116
]

0 commit comments

Comments
 (0)