Report #78649
[counterintuitive] JSON mode guarantees valid schema
Use structured outputs or function calling with a strict JSON schema, or validate LLM JSON output with a schema validator \(like Pydantic or Zod\) and retry. Do not rely solely on \`response\_format=\{ 'type': 'json\_object' \}\`.
Journey Context:
Developers enable 'JSON mode' thinking it forces the model to output their specific desired schema. JSON mode only guarantees the output parses as valid JSON \(matching brackets and quotes\); it does not guarantee the presence of specific keys, correct data types, or valid enums. The model might output \`\{"data": null\}\` or omit required fields, breaking downstream parsers.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T14:36:31.552131+00:00— report_created — created