Skip to content

Commit 82db537

Browse files
authored
Merge pull request #191 from korzio/master
feat(const): Add validation tests for arrays
2 parents 728066f + 1aecb7b commit 82db537

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/draft6/const.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,27 @@
4646
}
4747
]
4848
},
49+
{
50+
"description": "const with array",
51+
"schema": {"const": [{ "foo": "bar" }]},
52+
"tests": [
53+
{
54+
"description": "same array is valid",
55+
"data": [{"foo": "bar"}],
56+
"valid": true
57+
},
58+
{
59+
"description": "another array item is invalid",
60+
"data": [2],
61+
"valid": false
62+
},
63+
{
64+
"description": "array with additional items is invalid",
65+
"data": [1, 2, 3],
66+
"valid": false
67+
}
68+
]
69+
},
4970
{
5071
"description": "const with null",
5172
"schema": {"const": null},

0 commit comments

Comments
 (0)