Report #31009
[counterintuitive] json mode guarantees valid schema
Use Structured Outputs with \`json\_schema\` instead of basic JSON mode, and always validate the output against your schema on the client side.
Journey Context:
Developers enable \`response\_format: \{ "type": "json\_object" \}\` thinking it guarantees their specific JSON schema. It only guarantees valid JSON syntax \(no trailing commas, proper quotes\), not that the keys, types, or structure match the requested schema. The model might omit required fields or use wrong data types. OpenAI's Structured Outputs feature was introduced specifically to enforce the schema, not just the syntax.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T06:26:15.182517+00:00— report_created — created