Skip to content
Docs

Schema Validation

AJV-based JSON Schema per route. Directions: request validation (sanitize/reject malformed inputs) and response validation (enforce structured-output schemas on LLM completions — for example, JSON-mode outputs that must match a published Order schema). Modes:

  • reject — non-compliant outputs return 502 and never reach the client
  • warn — log violation, pass through
  • transform — coerce to schema where possible

Any non-compliant LLM output can also be re-prompted through the enrichment pipeline (Section 26) — the original prompt is re-sent with an inline “previous response did not match schema X” hint, ensuring only valid data reaches the application. APIs: CRUD, validate, violations, stats.