105 lines
2.6 KiB
JSON
105 lines
2.6 KiB
JSON
[
|
|
{
|
|
"description": "maxItems validation",
|
|
"database": {
|
|
"schemas": [
|
|
{
|
|
"maxItems": 2,
|
|
"extensible": true,
|
|
"$id": "maxItems_0_0"
|
|
}
|
|
]
|
|
},
|
|
"tests": [
|
|
{
|
|
"description": "shorter is valid",
|
|
"data": [
|
|
1
|
|
],
|
|
"valid": true,
|
|
"schema_id": "maxItems_0_0"
|
|
},
|
|
{
|
|
"description": "exact length is valid",
|
|
"data": [
|
|
1,
|
|
2
|
|
],
|
|
"valid": true,
|
|
"schema_id": "maxItems_0_0"
|
|
},
|
|
{
|
|
"description": "too long is invalid",
|
|
"data": [
|
|
1,
|
|
2,
|
|
3
|
|
],
|
|
"valid": false,
|
|
"schema_id": "maxItems_0_0"
|
|
},
|
|
{
|
|
"description": "ignores non-arrays",
|
|
"data": "foobar",
|
|
"valid": true,
|
|
"schema_id": "maxItems_0_0"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "maxItems validation with a decimal",
|
|
"database": {
|
|
"schemas": [
|
|
{
|
|
"maxItems": 2,
|
|
"extensible": true,
|
|
"$id": "maxItems_1_0"
|
|
}
|
|
]
|
|
},
|
|
"tests": [
|
|
{
|
|
"description": "shorter is valid",
|
|
"data": [
|
|
1
|
|
],
|
|
"valid": true,
|
|
"schema_id": "maxItems_1_0"
|
|
},
|
|
{
|
|
"description": "too long is invalid",
|
|
"data": [
|
|
1,
|
|
2,
|
|
3
|
|
],
|
|
"valid": false,
|
|
"schema_id": "maxItems_1_0"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "extensible: true allows extra items in maxItems (but counted)",
|
|
"database": {
|
|
"schemas": [
|
|
{
|
|
"maxItems": 2,
|
|
"extensible": true,
|
|
"$id": "maxItems_2_0"
|
|
}
|
|
]
|
|
},
|
|
"tests": [
|
|
{
|
|
"description": "extra item counted towards maxItems",
|
|
"data": [
|
|
1,
|
|
2,
|
|
3
|
|
],
|
|
"valid": false,
|
|
"schema_id": "maxItems_2_0"
|
|
}
|
|
]
|
|
}
|
|
] |