Schema Validation

With parsing and reference resolution complete, we built out the validation layer—including the tricky Draft 2020-12 features that most implementations skip.

Schema Tree-Shaking

Unused definitions are automatically eliminated when extracting subschemas. An OpenAPI spec with hundreds of schemas produces operation-specific extracts containing only the types that operation actually uses. The tree-shaker follows $ref, $dynamicRef, allOf, anyOf, oneOf, items, properties, and all other schema-containing keywords.

Annotation Tracking

Complete JSON Schema validation with detailed error reporting. Annotation tracking collects all keyword annotations for determining which properties and items were evaluated—required for unevaluatedProperties and unevaluatedItems semantics in Draft 2020-12.

Lenient and Strict Modes

Lenient mode (default) skips invalid keywords instead of throwing. Strict mode throws on unknown or invalid keywords. Both modes include frame-based error context for debugging.