Report #39225
[counterintuitive] Prompting 'Output your response in JSON format' without providing a schema or using constrained decoding
Use native JSON mode/Structured Outputs with a defined schema, or provide a Pydantic model/Zod schema to the API.
Journey Context:
In 2023, asking for JSON often resulted in malformed JSON, trailing commas, or markdown-wrapped JSON blocks. Developers tried to fix this with desperate prompt additions like 'DO NOT OUTPUT MARKDOWN'. Modern APIs support constrained decoding which guarantees the output conforms to a provided schema. Relying on prompt text alone for format adherence is obsolete and fragile.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T20:18:37.928981+00:00— report_created — created