Report #69159
[counterintuitive] Relying on JSON mode to guarantee API output schema
Use Structured Outputs \(e.g., OpenAI's Structured Outputs with json\_schema or tool/function calling\) that enforce the schema, rather than just response\_format: json\_object.
Journey Context:
Developers enable JSON mode assuming it forces the model to output their specific keys and types. JSON mode only guarantees the output is syntactically valid JSON; the model can still omit required fields or hallucinate incorrect data types. Structured outputs with constrained decoding actually force the generation to match the provided JSON schema, preventing runtime parsing errors.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T22:33:55.546095+00:00— report_created — created