Skip to content

Commit 7e4b937

Browse files
committed
max/min Items/Length
1 parent 5c27f85 commit 7e4b937

File tree

4 files changed

+92
-0
lines changed

4 files changed

+92
-0
lines changed

tests/draft3/maxItems.json

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[
2+
{
3+
"description": "maxItems validation",
4+
"schema": {"maxItems": 2},
5+
"tests": [
6+
{
7+
"description": "shorter is valid",
8+
"data": [1],
9+
"valid": true
10+
},
11+
{
12+
"description": "exact length is valid",
13+
"data": [1, 2],
14+
"valid": true
15+
},
16+
{
17+
"description": "too long is invalid",
18+
"data": [1, 2, 3],
19+
"valid": false
20+
}
21+
]
22+
}
23+
]

tests/draft3/maxLength.json

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[
2+
{
3+
"description": "maxLength validation",
4+
"schema": {"maxLength": 2},
5+
"tests": [
6+
{
7+
"description": "shorter is valid",
8+
"data": "f",
9+
"valid": true
10+
},
11+
{
12+
"description": "exact length is valid",
13+
"data": "fo",
14+
"valid": true
15+
},
16+
{
17+
"description": "too long is invalid",
18+
"data": "foo",
19+
"valid": false
20+
}
21+
]
22+
}
23+
]

tests/draft3/minItems.json

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[
2+
{
3+
"description": "minItems validation",
4+
"schema": {"minItems": 1},
5+
"tests": [
6+
{
7+
"description": "longer is valid",
8+
"data": [1, 2],
9+
"valid": true
10+
},
11+
{
12+
"description": "exact length is valid",
13+
"data": [1],
14+
"valid": true
15+
},
16+
{
17+
"description": "too short is invalid",
18+
"data": [],
19+
"valid": false
20+
}
21+
]
22+
}
23+
]

tests/draft3/minLength.json

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[
2+
{
3+
"description": "minLength validation",
4+
"schema": {"minLength": 2},
5+
"tests": [
6+
{
7+
"description": "longer is valid",
8+
"data": "foo",
9+
"valid": true
10+
},
11+
{
12+
"description": "exact length is valid",
13+
"data": "fo",
14+
"valid": true
15+
},
16+
{
17+
"description": "too short is invalid",
18+
"data": "f",
19+
"valid": false
20+
}
21+
]
22+
}
23+
]

0 commit comments

Comments
 (0)