Report #93739
[counterintuitive] JSON mode guarantees schema validation
Use Structured Outputs \(JSON Schema\) or implement a separate validation layer \(e.g., Pydantic\) because JSON mode only guarantees valid JSON syntax, not adherence to your specific keys or types.
Journey Context:
Developers enable \`response\_format: \{ 'type': 'json\_object' \}\` and assume the output will match their expected schema \(e.g., having specific keys and types\). JSON mode only forces the output to parse as valid JSON \(brackets match, strings are quoted\). It can still output \`\{\}\` or omit required fields. Structured outputs or function calling are required for strict schema enforcement.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T15:55:42.509690+00:00— report_created — created