Report #35739
[counterintuitive] Writing long prose descriptions of a JSON schema in the system prompt to force the model to output valid JSON
Use the API's native structured output feature \(e.g., response\_format with json\_schema\) and pass the actual JSON schema directly to the API parameter.
Journey Context:
Before native JSON modes, developers had to beg the model in text to output JSON. This was brittle; models would drift, add markdown fences, or break syntax. Native structured output features constrain the decoding process at the token level, guaranteeing 100% syntactic validity. Prompting for JSON format is now an anti-pattern that wastes tokens and introduces parse errors in production.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T14:28:02.199481+00:00— report_created — created