193 lines
5.2 KiB
JSON
193 lines
5.2 KiB
JSON
[
|
|
{
|
|
"description": "a schema given for prefixItems",
|
|
"database": {
|
|
"schemas": [
|
|
{
|
|
"prefixItems": [
|
|
{
|
|
"type": "integer"
|
|
},
|
|
{
|
|
"type": "string"
|
|
}
|
|
],
|
|
"$id": "prefixItems_0_0"
|
|
}
|
|
]
|
|
},
|
|
"tests": [
|
|
{
|
|
"description": "correct types",
|
|
"data": [
|
|
1,
|
|
"foo"
|
|
],
|
|
"valid": true,
|
|
"schema_id": "prefixItems_0_0"
|
|
},
|
|
{
|
|
"description": "wrong types",
|
|
"data": [
|
|
"foo",
|
|
1
|
|
],
|
|
"valid": false,
|
|
"schema_id": "prefixItems_0_0"
|
|
},
|
|
{
|
|
"description": "incomplete array of items",
|
|
"data": [
|
|
1
|
|
],
|
|
"valid": true,
|
|
"schema_id": "prefixItems_0_0"
|
|
},
|
|
{
|
|
"description": "array with additional items (invalid due to strictness)",
|
|
"data": [
|
|
1,
|
|
"foo",
|
|
true
|
|
],
|
|
"valid": false,
|
|
"schema_id": "prefixItems_0_0"
|
|
},
|
|
{
|
|
"description": "empty array",
|
|
"data": [],
|
|
"valid": true,
|
|
"schema_id": "prefixItems_0_0"
|
|
},
|
|
{
|
|
"description": "JavaScript pseudo-array is valid (invalid due to strict object validation)",
|
|
"data": {
|
|
"0": "invalid",
|
|
"1": "valid",
|
|
"length": 2
|
|
},
|
|
"valid": false,
|
|
"schema_id": "prefixItems_0_0"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "prefixItems with boolean schemas",
|
|
"database": {
|
|
"schemas": [
|
|
{
|
|
"prefixItems": [
|
|
true,
|
|
false
|
|
],
|
|
"$id": "prefixItems_1_0"
|
|
}
|
|
]
|
|
},
|
|
"tests": [
|
|
{
|
|
"description": "array with one item is valid",
|
|
"data": [
|
|
1
|
|
],
|
|
"valid": true,
|
|
"schema_id": "prefixItems_1_0"
|
|
},
|
|
{
|
|
"description": "array with two items is invalid",
|
|
"data": [
|
|
1,
|
|
"foo"
|
|
],
|
|
"valid": false,
|
|
"schema_id": "prefixItems_1_0"
|
|
},
|
|
{
|
|
"description": "empty array is valid",
|
|
"data": [],
|
|
"valid": true,
|
|
"schema_id": "prefixItems_1_0"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "additional items are allowed by default",
|
|
"database": {
|
|
"schemas": [
|
|
{
|
|
"prefixItems": [
|
|
{
|
|
"type": "integer"
|
|
}
|
|
],
|
|
"extensible": true,
|
|
"$id": "prefixItems_2_0"
|
|
}
|
|
]
|
|
},
|
|
"tests": [
|
|
{
|
|
"description": "only the first item is validated",
|
|
"data": [
|
|
1,
|
|
"foo",
|
|
false
|
|
],
|
|
"valid": true,
|
|
"schema_id": "prefixItems_2_0"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "prefixItems with null instance elements",
|
|
"database": {
|
|
"schemas": [
|
|
{
|
|
"prefixItems": [
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"$id": "prefixItems_3_0"
|
|
}
|
|
]
|
|
},
|
|
"tests": [
|
|
{
|
|
"description": "allows null elements",
|
|
"data": [
|
|
null
|
|
],
|
|
"valid": true,
|
|
"schema_id": "prefixItems_3_0"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "extensible: true allows extra items with prefixItems",
|
|
"database": {
|
|
"schemas": [
|
|
{
|
|
"prefixItems": [
|
|
{
|
|
"type": "integer"
|
|
}
|
|
],
|
|
"extensible": true,
|
|
"$id": "prefixItems_4_0"
|
|
}
|
|
]
|
|
},
|
|
"tests": [
|
|
{
|
|
"description": "extra item is valid",
|
|
"data": [
|
|
1,
|
|
"foo"
|
|
],
|
|
"valid": true,
|
|
"schema_id": "prefixItems_4_0"
|
|
}
|
|
]
|
|
}
|
|
] |