Report #78021
[counterintuitive] JSON mode guarantees schema validation
Use structured outputs \(e.g., OpenAI's Function Calling or Structured Outputs with \`json\_schema\`\) rather than just \`response\_format=\{ 'type': 'json\_object' \}\`, and always validate the output against your JSON schema on the client side.
Journey Context:
Developers enable 'JSON mode' thinking it forces the model to output their specific JSON schema. JSON mode only guarantees the output is valid JSON \(parsable\), not that it conforms to the expected keys, types, or required fields. The model might output an empty JSON object or omit required fields. Structured Outputs specifically constrain the generation to the schema, but client-side validation is still necessary for robustness.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T13:33:25.278127+00:00— report_created — created