feat: P2 JSON Schema support — allOf, if/then/else, patternProperties, prefixItems (#82) #87

Merged
xingyue merged 1 commits from feat/82-schema-p2 into main 2026-06-01 02:15:35 +00:00

1 Commits

Author SHA1 Message Date
xiaoju edff831e87 feat: P2 JSON Schema support — allOf, if/then/else, patternProperties, prefixItems (#82)
Add 10 new schema keywords:

Combinators/conditionals (with collectRefs support):
- allOf: array of sub-schemas, all must match
- if/then/else: conditional validation
- patternProperties: regex-keyed property schemas
- prefixItems: tuple validation (per-position schemas)

Leaf constraints:
- multipleOf, minProperties, maxProperties, default

Updated: ALLOWED_SCHEMA_KEYS, isValidSchema(), collectRefs(),
meta-schema (bootstrap.ts), and schema-validation tests.

13 new tests: schema acceptance, validation, rejection,
and collectRefs traversal for allOf/patternProperties/prefixItems.

510 tests, 0 fail.

Refs #82
2026-06-01 02:10:37 +00:00