Report #62046
[counterintuitive] JSON mode ensures output matches my schema
Use Structured Outputs with a strict JSON schema rather than basic JSON mode. Basic JSON mode only guarantees valid JSON syntax, not schema adherence.
Journey Context:
Developers enable 'JSON mode' thinking it forces the model to output their specific Pydantic schema. JSON mode only guarantees the output parses without error, but the model might emit an empty \{\}, omit required fields, or hallucinate extra fields. Newer Structured Outputs features actually constrain the token generation to match the provided schema.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T10:37:59.066125+00:00— report_created — created