Report #40159
[counterintuitive] Relying on basic 'JSON mode' \(response\_format: json\_object\) and prompt instructions to guarantee valid API schemas
Use Structured Outputs with a strict JSON Schema definition to guarantee 100% schema adherence and valid JSON parsing.
Journey Context:
Old JSON mode only guaranteed the output string would parse as valid JSON, but models would frequently invent extra fields, skip required ones, or hallucinate types. Developers had to write complex fallback parsers. Structured outputs constrain the decoding process to strictly follow the provided JSON schema, eliminating the need for defensive parsing and retry logic.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T21:52:43.535198+00:00— report_created — created