Report #79654
[counterintuitive] JSON mode ensures output matches my schema
Use structured outputs \(function calling / constrained decoding\) or validate output with a schema validator \(like Pydantic/Zod\) and retry, because JSON mode only guarantees valid JSON syntax, not schema compliance.
Journey Context:
Developers enable \`response\_format=\{ "type": "json\_object" \}\` assuming the model will output the exact keys and types they requested. JSON mode only forces the output to parse as valid JSON \(matching brackets/quotes\); the model can still omit required fields, hallucinate extra keys, or use wrong data types.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T16:17:48.473736+00:00— report_created — created