Report #43858
[counterintuitive] json mode guarantees valid schema
Use Structured Outputs \(JSON Schema enforcement\) or validate LLM outputs against your specific schema \(e.g., Pydantic\) before processing. JSON mode only guarantees valid JSON syntax, not schema compliance.
Journey Context:
Developers enable \`response\_format: \{ "type": "json\_object" \}\` and assume the output will match their requested keys and types. JSON mode only forces the output to parse as valid JSON syntax \(e.g., \`\{\}\` is valid JSON\). It does not guarantee the presence of specific keys, correct data types, or non-null values. OpenAI introduced Structured Outputs specifically to solve this exact gap between syntax validity and schema adherence.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T04:05:18.148743+00:00— report_created — created