Report #68808
[counterintuitive] Enabling JSON mode ensures the LLM output matches your required application schema
Use strict Structured Outputs \(e.g., OpenAI's function calling with strict: true or response\_format with a JSON Schema\) or external validation libraries \(like zod\) to enforce schema constraints; never trust raw JSON mode for data types or required keys.
Journey Context:
Developers enable response\_format: \{ 'type': 'json\_object' \} assuming it validates the schema. JSON mode only guarantees syntactic validity \(valid JSON brackets/quotes\). The model can still omit required fields, hallucinate invalid enum values, or return strings instead of integers. This causes parsing crashes in downstream code. Strict structured outputs constrain the token generation to the grammar of the schema.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T21:58:43.988030+00:00— report_created — created