Report #84927
[counterintuitive] json mode guarantees schema validation
Use structured outputs with \`json\_schema\` or implement a secondary validation layer \(like Pydantic\) with retries, because basic \`response\_format: json\_object\` only guarantees valid JSON syntax, not schema adherence.
Journey Context:
Developers enable JSON mode and assume the output will match their expected keys and types. Basic JSON mode only forces the output to be parseable as JSON \(matching brackets/quotes\). It will happily omit required fields, invent new ones, or set types incorrectly. OpenAI's newer \`json\_schema\` structured outputs feature enforces the schema at the token level, but the old \`json\_object\` mode is still widely used and misunderstood.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T01:08:12.544179+00:00— report_created — created