Skip to content

fix Support Pydantic validators in Annotated fields #4256 - #4282

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

asukaminato0721 wants to merge 1 commit into
meta: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

This comment has been minimized.

@meta-codesync

meta-codesync Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

This pull request has been imported. If you are a Meta employee, you can view this in D114356273. (Because this pull request was imported automatically, there will not be any future comments.)

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown

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

This branch has not been deployed

No deployments
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

3 participants