Report #101249
[counterintuitive] JSON mode guarantees valid and correct structured output
Treat JSON mode as a syntax guarantee, not a semantics guarantee. Validate schemas with a library like Pydantic or Zod, and handle parse/retry loops because the model can still emit malformed or semantically invalid JSON.
Journey Context:
Developers often enable JSON mode and assume the output will always match their expected shape. While it constrains tokens to valid JSON, it does not enforce field types, enum values, or business-logic constraints. Real-world failures include missing required keys, wrong types, and arrays where objects are expected. Always validate after generation and have a fallback.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-06T05:14:05.238525+00:00— report_created — created