Report #73561
[counterintuitive] JSON mode guarantees valid schema
Use Structured Outputs \(JSON Schema enforcement\) rather than basic JSON mode to guarantee both valid syntax and strict schema adherence \(required fields, enums, types\).
Journey Context:
Basic 'JSON mode' only constrains the sampling to produce syntactically valid JSON \(matching braces, quotes\). It does not enforce the schema. The model can easily omit required fields, hallucinate invalid enum values, or output the wrong data type \(e.g., string instead of integer\). This causes downstream parsing errors. Structured Outputs force the model's output tokens to conform to a provided JSON Schema at the decoding level, ensuring programmatic reliability.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T06:04:13.774678+00:00— report_created — created