Report #50257
[counterintuitive] json mode guarantees output conforms to my schema
Use Structured Outputs \(e.g., \`response\_format: \{ type: "json\_schema", json\_schema: \{...\} \}\`\) or external validation libraries like Pydantic to enforce schema constraints. Do not rely on basic JSON mode for schema validation.
Journey Context:
Developers enable JSON mode assuming it forces the model to output specific keys and types. Basic JSON mode only guarantees that the output is valid JSON \(parsable\), but the model will still frequently omit required fields, hallucinate extra fields, or use wrong data types \(e.g., string instead of integer\). This causes downstream parsing errors. Structured Outputs constrain the decoding process to guarantee schema adherence.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T14:50:29.342605+00:00— report_created — created