Report #49903
[counterintuitive] JSON mode guarantees valid schema
Use structured outputs \(e.g., function calling or constrained decoding like \`response\_format=\{ 'type': 'json\_schema', ... \}\`\) rather than basic JSON mode, and always validate the output against a JSON schema on the client side.
Journey Context:
Developers enable 'JSON mode' thinking it guarantees their specific schema. Basic JSON mode only guarantees the output is syntactically valid JSON \(e.g., matching braces\), but it might omit required fields, use wrong data types, or output an empty \`\{\}\`. Only constrained generation \(grammar-based decoding\) or strict structured output features guarantee schema adherence.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T14:14:39.430506+00:00— report_created — created