Report #68334
[counterintuitive] enabling JSON mode guarantees valid JSON schema
Use Structured Outputs \(function calling or json\_schema response format\) rather than basic \`json\_object\` mode, and always validate the output schema on the client side.
Journey Context:
Developers enable \`response\_format=\{ "type": "json\_object" \}\` and assume the output will match their expected keys. Basic JSON mode only guarantees the string parses as valid JSON \(e.g., \`\{\}\` is valid JSON\). It does \*not\* guarantee the presence of specific keys, data types, or non-empty values. The model can still return \`\{"data": null\}\` or omit required fields entirely. Structured Outputs with a strict JSON schema constraint the token generation to match the schema exactly.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T21:11:04.475184+00:00— report_created — created