Report #47351
[counterintuitive] json mode guarantees schema validation
Use structured outputs \(e.g., OpenAI's Structured Outputs with \`json\_schema\`, or libraries like Instructor\) instead of just \`response\_format: \{ type: json\_object \}\`. Always validate the output on the server side.
Journey Context:
Developers enable JSON mode and assume the output will match their expected schema \(e.g., specific keys, types\). Early JSON modes only guaranteed valid JSON syntax \(i.e., it parses without error\), not that it conforms to a specific schema. It could return \`\{\}\` or omit required fields. OpenAI introduced Structured Outputs to fix this, but the old JSON mode misconception persists.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T09:57:41.606769+00:00— report_created — created