Latest Results
Keep additionalProperties value constraints in annotated output
parse_item promotes a constrained primitive to a constrained sub-type (so a
Meta/Field can carry ge/le/pattern/etc.) only when a parent is passed.
parse_list_item passes parent, so a constrained array item keeps its
constraint, but the additionalProperties branch of parse_item did not, so a
constrained dict value silently dropped it whenever field_constraints is on
(msgspec, and pydantic_v2/dataclasses with --use-annotated).
So `{"additionalProperties": {"type": "integer", "minimum": 1, "maximum": 9}}`
generated `dict[str, int]` in those modes, while the sibling array item and the
pydantic-inline output (dict[str, conint(ge=1, le=9)]) both kept the bound.
Pass parent=item to that call so the dict value is promoted the same way the
list item is. pydantic_v2 inline output is unchanged.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Andrew Chen <48723787+chuenchen309@users.noreply.github.com>chuenchen309:fix/additional-properties-value-constraints Latest Branches
-30%
pre-commit-ci-update-config -34%
chuenchen309:fix/additional-properties-value-constraints +1%
chuenchen309:fix/msgspec-field-name-shadow © 2026 CodSpeed Technology