Report #41272
[counterintuitive] JSON mode guarantees valid JSON schema
Use strict Structured Outputs \(e.g., \`json\_schema\` response format\) or function/tool calling to enforce schema constraints like required fields and types, rather than relying on basic JSON mode.
Journey Context:
Developers enable \`response\_format: \{ 'type': 'json\_object' \}\` assuming it forces the model to output JSON matching their specific schema. Basic JSON mode only guarantees the output is syntactically valid JSON \(matching brackets, quotes\); it does \*not\* guarantee the presence of specific keys, correct data types, or required nested structures. The model can easily return \`\{ 'error': 'I don't know' \}\` or omit required fields. To guarantee schema adherence, you must use explicit schema enforcement features like OpenAI's Structured Outputs with \`json\_schema\`, which uses constrained decoding to only allow tokens that match the provided schema.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T23:44:58.253017+00:00— report_created — created