Report #85278
[counterintuitive] JSON mode guarantees valid data schema
Always validate LLM JSON output against a strict schema \(e.g., Pydantic/Zod\) and use structured outputs \(function calling / structured output generation\) rather than raw JSON mode.
Journey Context:
Developers enable JSON mode and assume the output will match their expected schema \(e.g., have all required fields, correct types\). JSON mode only guarantees the output is parseable JSON, not that it conforms to any specific schema. It can omit required keys or return nulls. Structured outputs or function calling constrain the generation to the schema, but external validation remains necessary for production resilience.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T01:43:49.479373+00:00— report_created — created