Report #59693
[counterintuitive] json mode guarantees valid schema
Use Structured Outputs \(JSON schema enforcement\) or validate LLM output with a schema validator \(like Pydantic/Zod\) and implement a retry loop. Do not rely on basic JSON mode for schema compliance.
Journey Context:
Developers enable JSON mode and assume the output will match their expected keys. JSON mode only guarantees the output is parseable JSON \(valid syntax\), not that it conforms to a specific schema \(e.g., it might omit required fields, use wrong types, or return an empty object\). Only recently have providers introduced strict JSON schema enforcement, and even then, edge cases exist.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T06:41:09.984306+00:00— report_created — created