jspg checkpoint

This commit is contained in:
2026-06-23 19:48:38 -04:00
parent 9900b3fc43
commit a1fb9ef650
24 changed files with 588 additions and 3801 deletions

View File

@ -213,603 +213,6 @@
}
]
},
{
"description": "items and subitems",
"database": {
"types": [
{
"name": "items_3_0",
"schemas": {
"items_3_0": {
"type": "array",
"items": false,
"prefixItems": [
{
"type": "item"
},
{
"type": "item"
},
{
"type": "item"
}
]
}
}
},
{
"name": "item",
"schemas": {
"item": {
"type": "array",
"items": false,
"prefixItems": [
{
"type": "sub-item"
},
{
"type": "sub-item"
}
]
}
}
},
{
"name": "sub-item",
"schemas": {
"sub-item": {
"type": "object",
"required": [
"foo"
]
}
}
}
]
},
"tests": [
{
"description": "valid items",
"data": [
[
{
"foo": null
},
{
"foo": null
}
],
[
{
"foo": null
},
{
"foo": null
}
],
[
{
"foo": null
},
{
"foo": null
}
]
],
"schema_id": "items_3_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "STRICT_PROPERTY_VIOLATION",
"values": {
"property_name": "foo"
},
"details": {
"path": "0/0/foo",
"schema": "items_3_0"
}
},
{
"code": "STRICT_PROPERTY_VIOLATION",
"values": {
"property_name": "foo"
},
"details": {
"path": "0/1/foo",
"schema": "items_3_0"
}
},
{
"code": "STRICT_PROPERTY_VIOLATION",
"values": {
"property_name": "foo"
},
"details": {
"path": "1/0/foo",
"schema": "items_3_0"
}
},
{
"code": "STRICT_PROPERTY_VIOLATION",
"values": {
"property_name": "foo"
},
"details": {
"path": "1/1/foo",
"schema": "items_3_0"
}
},
{
"code": "STRICT_PROPERTY_VIOLATION",
"values": {
"property_name": "foo"
},
"details": {
"path": "2/0/foo",
"schema": "items_3_0"
}
},
{
"code": "STRICT_PROPERTY_VIOLATION",
"values": {
"property_name": "foo"
},
"details": {
"path": "2/1/foo",
"schema": "items_3_0"
}
}
]
}
},
{
"description": "too many items",
"data": [
[
{
"foo": null
},
{
"foo": null
}
],
[
{
"foo": null
},
{
"foo": null
}
],
[
{
"foo": null
},
{
"foo": null
}
],
[
{
"foo": null
},
{
"foo": null
}
]
],
"schema_id": "items_3_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "STRICT_PROPERTY_VIOLATION",
"values": {
"property_name": "foo"
},
"details": {
"path": "0/0/foo",
"schema": "items_3_0"
}
},
{
"code": "STRICT_PROPERTY_VIOLATION",
"values": {
"property_name": "foo"
},
"details": {
"path": "0/1/foo",
"schema": "items_3_0"
}
},
{
"code": "STRICT_PROPERTY_VIOLATION",
"values": {
"property_name": "foo"
},
"details": {
"path": "1/0/foo",
"schema": "items_3_0"
}
},
{
"code": "STRICT_PROPERTY_VIOLATION",
"values": {
"property_name": "foo"
},
"details": {
"path": "1/1/foo",
"schema": "items_3_0"
}
},
{
"code": "STRICT_PROPERTY_VIOLATION",
"values": {
"property_name": "foo"
},
"details": {
"path": "2/0/foo",
"schema": "items_3_0"
}
},
{
"code": "STRICT_PROPERTY_VIOLATION",
"values": {
"property_name": "foo"
},
"details": {
"path": "2/1/foo",
"schema": "items_3_0"
}
},
{
"code": "FALSE_SCHEMA",
"details": {
"path": "3",
"schema": "items_3_0"
}
}
]
}
},
{
"description": "too many sub-items",
"data": [
[
{
"foo": null
},
{
"foo": null
},
{
"foo": null
}
],
[
{
"foo": null
},
{
"foo": null
}
],
[
{
"foo": null
},
{
"foo": null
}
]
],
"schema_id": "items_3_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "STRICT_PROPERTY_VIOLATION",
"values": {
"property_name": "foo"
},
"details": {
"path": "0/0/foo",
"schema": "items_3_0"
}
},
{
"code": "STRICT_PROPERTY_VIOLATION",
"values": {
"property_name": "foo"
},
"details": {
"path": "0/1/foo",
"schema": "items_3_0"
}
},
{
"code": "FALSE_SCHEMA",
"details": {
"path": "0/2",
"schema": "items_3_0"
}
},
{
"code": "STRICT_PROPERTY_VIOLATION",
"values": {
"property_name": "foo"
},
"details": {
"path": "1/0/foo",
"schema": "items_3_0"
}
},
{
"code": "STRICT_PROPERTY_VIOLATION",
"values": {
"property_name": "foo"
},
"details": {
"path": "1/1/foo",
"schema": "items_3_0"
}
},
{
"code": "STRICT_PROPERTY_VIOLATION",
"values": {
"property_name": "foo"
},
"details": {
"path": "2/0/foo",
"schema": "items_3_0"
}
},
{
"code": "STRICT_PROPERTY_VIOLATION",
"values": {
"property_name": "foo"
},
"details": {
"path": "2/1/foo",
"schema": "items_3_0"
}
}
]
}
},
{
"description": "wrong item",
"data": [
{
"foo": null
},
[
{
"foo": null
},
{
"foo": null
}
],
[
{
"foo": null
},
{
"foo": null
}
]
],
"schema_id": "items_3_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "INVALID_TYPE",
"values": {
"expected": "array"
},
"details": {
"path": "0",
"schema": "items_3_0"
}
},
{
"code": "STRICT_PROPERTY_VIOLATION",
"values": {
"property_name": "foo"
},
"details": {
"path": "0/foo",
"schema": "items_3_0"
}
},
{
"code": "STRICT_PROPERTY_VIOLATION",
"values": {
"property_name": "foo"
},
"details": {
"path": "1/0/foo",
"schema": "items_3_0"
}
},
{
"code": "STRICT_PROPERTY_VIOLATION",
"values": {
"property_name": "foo"
},
"details": {
"path": "1/1/foo",
"schema": "items_3_0"
}
},
{
"code": "STRICT_PROPERTY_VIOLATION",
"values": {
"property_name": "foo"
},
"details": {
"path": "2/0/foo",
"schema": "items_3_0"
}
},
{
"code": "STRICT_PROPERTY_VIOLATION",
"values": {
"property_name": "foo"
},
"details": {
"path": "2/1/foo",
"schema": "items_3_0"
}
}
]
}
},
{
"description": "wrong sub-item",
"data": [
[
{},
{
"foo": null
}
],
[
{
"foo": null
},
{
"foo": null
}
],
[
{
"foo": null
},
{
"foo": null
}
]
],
"schema_id": "items_3_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "REQUIRED_FIELD_MISSING",
"values": {
"field_name": "foo"
},
"details": {
"path": "0/0/foo",
"schema": "items_3_0"
}
},
{
"code": "STRICT_PROPERTY_VIOLATION",
"values": {
"property_name": "foo"
},
"details": {
"path": "0/1/foo",
"schema": "items_3_0"
}
},
{
"code": "STRICT_PROPERTY_VIOLATION",
"values": {
"property_name": "foo"
},
"details": {
"path": "1/0/foo",
"schema": "items_3_0"
}
},
{
"code": "STRICT_PROPERTY_VIOLATION",
"values": {
"property_name": "foo"
},
"details": {
"path": "1/1/foo",
"schema": "items_3_0"
}
},
{
"code": "STRICT_PROPERTY_VIOLATION",
"values": {
"property_name": "foo"
},
"details": {
"path": "2/0/foo",
"schema": "items_3_0"
}
},
{
"code": "STRICT_PROPERTY_VIOLATION",
"values": {
"property_name": "foo"
},
"details": {
"path": "2/1/foo",
"schema": "items_3_0"
}
}
]
}
},
{
"description": "fewer items is invalid",
"data": [
[
{
"foo": null
}
],
[
{
"foo": null
}
]
],
"schema_id": "items_3_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "STRICT_PROPERTY_VIOLATION",
"values": {
"property_name": "foo"
},
"details": {
"path": "0/0/foo",
"schema": "items_3_0"
}
},
{
"code": "STRICT_PROPERTY_VIOLATION",
"values": {
"property_name": "foo"
},
"details": {
"path": "1/0/foo",
"schema": "items_3_0"
}
}
]
}
}
]
},
{
"description": "nested items",
"database": {
@ -1021,282 +424,6 @@
}
]
},
{
"description": "prefixItems with no additional items allowed",
"database": {
"types": [
{
"name": "items_5_0",
"schemas": {
"items_5_0": {
"prefixItems": [
{},
{},
{}
],
"items": false
}
}
}
]
},
"tests": [
{
"description": "empty array",
"data": [],
"schema_id": "items_5_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "fewer number of items present (1)",
"data": [
1
],
"schema_id": "items_5_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "fewer number of items present (2)",
"data": [
1,
2
],
"schema_id": "items_5_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "equal number of items present",
"data": [
1,
2,
3
],
"schema_id": "items_5_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "additional items are not permitted",
"data": [
1,
2,
3,
4
],
"schema_id": "items_5_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FALSE_SCHEMA",
"details": {
"path": "3",
"schema": "items_5_0"
}
}
]
}
}
]
},
{
"description": "items does not look in applicators, valid case",
"database": {
"types": [
{
"name": "items_6_0",
"schemas": {
"items_6_0": {
"allOf": [
{
"prefixItems": [
{
"minimum": 3
}
]
}
],
"items": {
"minimum": 5
}
}
}
}
]
},
"tests": [
{
"description": "prefixItems in allOf does not constrain items, invalid case",
"data": [
3,
5
],
"schema_id": "items_6_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "MINIMUM_VIOLATED",
"values": {
"limit": "5",
"value": "3"
},
"details": {
"path": "0",
"schema": "items_6_0"
}
}
]
}
},
{
"description": "prefixItems in allOf does not constrain items, valid case",
"data": [
5,
5
],
"schema_id": "items_6_0",
"action": "validate",
"expect": {
"success": true
}
}
]
},
{
"description": "prefixItems validation adjusts the starting index for items",
"database": {
"types": [
{
"name": "items_7_0",
"schemas": {
"items_7_0": {
"prefixItems": [
{
"type": "string"
}
],
"items": {
"type": "integer"
}
}
}
}
]
},
"tests": [
{
"description": "valid items",
"data": [
"x",
2,
3
],
"schema_id": "items_7_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "wrong type of second item",
"data": [
"x",
"y"
],
"schema_id": "items_7_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "INVALID_TYPE",
"values": {
"expected": "integer"
},
"details": {
"path": "1",
"schema": "items_7_0"
}
}
]
}
}
]
},
{
"description": "items with heterogeneous array",
"database": {
"types": [
{
"name": "items_8_0",
"schemas": {
"items_8_0": {
"prefixItems": [
{}
],
"items": false
}
}
}
]
},
"tests": [
{
"description": "heterogeneous invalid instance",
"data": [
"foo",
"bar",
37
],
"schema_id": "items_8_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FALSE_SCHEMA",
"details": {
"path": "1",
"schema": "items_8_0"
}
},
{
"code": "FALSE_SCHEMA",
"details": {
"path": "2",
"schema": "items_8_0"
}
}
]
}
},
{
"description": "valid instance",
"data": [
null
],
"schema_id": "items_8_0",
"action": "validate",
"expect": {
"success": true
}
}
]
},
{
"description": "items with null instance elements",
"database": {
@ -1460,56 +587,6 @@
}
]
},
{
"description": "array: strict array",
"database": {
"types": [
{
"name": "items_13_0",
"schemas": {
"items_13_0": {
"type": "array",
"extensible": false
}
}
}
]
},
"tests": [
{
"description": "empty array is valid",
"data": [],
"schema_id": "items_13_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "array with items is invalid (strict)",
"data": [
1
],
"schema_id": "items_13_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "STRICT_ITEM_VIOLATION",
"values": {
"index": "0"
},
"details": {
"path": "0",
"schema": "items_13_0"
}
}
]
}
}
]
},
{
"description": "array: items extensible",
"database": {