Report #39203
[counterintuitive] json mode ensures valid schema
Use Structured Outputs \(JSON Schema enforcement\) via API features or constrained decoding libraries, rather than just enabling basic JSON mode.
Journey Context:
Developers enable \`response\_format: \{ type: "json\_object" \}\` assuming the output will match their expected schema \(keys, types, required fields\). Basic JSON mode only guarantees the output parses as valid JSON; it does not guarantee the presence of specific keys, correct data types, or adherence to a schema. The model can legally return \`\{\}\` or omit required fields. Structured outputs and constrained decoding actually force the model to emit tokens conforming to the grammar/schema.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T20:16:34.337907+00:00— report_created — created