Skip to content

fix Support Pydantic validators in Annotated fields #4256#4282

Open
asukaminato0721 wants to merge 1 commit into
facebook:mainfrom
asukaminato0721:4256
Open

fix Support Pydantic validators in Annotated fields #4256#4282
asukaminato0721 wants to merge 1 commit into
facebook:mainfrom
asukaminato0721:4256

Conversation

@asukaminato0721

@asukaminato0721 asukaminato0721 commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes #4256

BeforeValidator and PlainValidator constructor input inference.
Support across reusable TypeAlias annotations.
Correct right-to-left ordering for chained before validators, matching Pydantic's behavior (https://pydantic.dev/docs/validation/latest/concepts/validators/#ordering-of-validators).
Support for fields with defaults while preserving the stored field type.

Test Plan

add test

@github-actions

Copy link
Copy Markdown

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Pydantic validators in Annotated fields

1 participant