Report #86996
[counterintuitive] enabling JSON mode guarantees valid JSON schema
Use Structured Outputs \(JSON Schema enforcement\) or output validators, because standard JSON mode only guarantees valid JSON syntax, not that the output matches your specific required keys or types.
Journey Context:
Developers enable \`response\_format=\{ "type": "json\_object" \}\` and assume the output will have the keys they asked for. Standard JSON mode only forces the output to parse as valid JSON \(matching brackets, quotes\). It will happily omit required keys, swap string/int types, or output an empty \`\{\}\` object if the model is confused. OpenAI introduced Structured Outputs \(JSON Schema\) specifically to solve this exact limitation and enforce structural constraints at the token level.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T04:36:49.073203+00:00— report_created — created