Skip to content

Commit 654cc26

Browse files
committed
Added tests for items when data contains more or less types than the
schema What happens if you specify items as an array of types, but you don't include a value for every type? Right now we have no tests for that. We also don't have a test for when there are more values than defined item types.
1 parent 5fb3d9f commit 654cc26

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/draft4/items.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,21 @@
4040
"description": "wrong types",
4141
"data": [ "foo", 1 ],
4242
"valid": false
43+
},
44+
{
45+
"description": "incomplete array of items",
46+
"data": [ 1 ],
47+
"valid": true
48+
},
49+
{
50+
"description": "array with additional items",
51+
"data": [ 1, "foo", true ],
52+
"valid": true
53+
},
54+
{
55+
"description": "empty array",
56+
"data": [ ],
57+
"valid": true
4358
}
4459
]
4560
}

0 commit comments

Comments
 (0)