Report #50629
[counterintuitive] enabling JSON mode guarantees valid JSON schema
Use Structured Outputs \(JSON Schema enforcement\) or implement a secondary validation/parser \(like Pydantic\) with retry logic, because JSON mode only guarantees valid JSON syntax, not that the payload conforms to your expected keys/types.
Journey Context:
Developers enable \`response\_format: \{ 'type': 'json\_object' \}\` and assume the output will match their desired schema. JSON mode only forces the output to be syntactically valid JSON \(i.e., matching braces\). It will often omit required keys or output wrong data types. OpenAI had to introduce 'Structured Outputs' \(Function Calling/JSON Schema enforcement\) specifically because basic JSON mode was insufficient for schema guarantees.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T15:27:48.530086+00:00— report_created — created