You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
transform_schema drops description beside $ref, which the API accepts and follows #2016
When a property has a $ref, transform_schema returns {"$ref": ...} alone and drops the keywords beside it, including description. Pydantic puts a field's Field(description=...) beside the $ref whenever the field's type is an enum or a model, so those descriptions never reach Claude when a model goes through transform_schema.
The API accepts the description there and the model follows it. Sending the pydantic schema above (with additionalProperties: false) directly as output_config={"format": {"type": "json_schema", "schema": ...}} to claude-haiku-5-5, with the prompt "Rate your confidence that 2+2=4.", returned {"level":"low"}.
Expected: transform_schema keeps description beside $ref. A workaround is to put the text in the enum's docstring, which becomes the $defs entry's description.
anthropic 1.13.0, pydantic 2.14.0. Related: #1817, #1764. Found and reproduced with Claude Code.
Activity
Parsiffall1 commentedon Oct 11, 2026
I'll take this — preserve
description(andtitle) beside$refintransform_schemaso Pydantic field descriptions reach the API.