Report #82135
[synthesis] Downstream schema validation fails because models omit required fields or add unsolicited extra fields
Use a strict validation layer \(like Pydantic\) that strips extra fields and validates non-empty constraints, because Claude adds unsolicited fields, Gemini populates required fields with empty strings, and GPT-4o omits them.
Journey Context:
When using structured output schemas, developers assume the output will perfectly match. GPT-4o \(in strict mode\) strictly omits fields not in the schema. Claude 3.5 Sonnet might occasionally add extra fields or metadata if it thinks it's helpful. Gemini 1.5 Pro strictly adheres to the schema but sometimes fails to populate required fields, leaving them as empty strings instead of omitting them. If your downstream code assumes strict schema adherence, Claude's extras will crash strict parsers, and Gemini's empty strings will crash non-null validators. A robust validation layer is mandatory.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T20:27:25.706835+00:00— report_created — created