The Fix
pip install pydantic==2.11.0
Based on closed pydantic/pydantic issue #11552 · PR/commit linked
Production note: Most teams hit this during upgrades or environment changes. Roll out with a canary and smoke critical endpoints (health, OpenAPI/docs) before 100%.
@@ -322,6 +322,9 @@ By leveraging the new [`type` statement](https://typing.readthedocs.io/en/latest
Only metadata that can be applied to the annotated type itself is allowed
(e.g. [validation constraints](./fields.md#field-constraints) and JSON metadata).
+ Trying to support field-specific metadata would require eagerly inspecting the
+ type alias's [`__value__`][typing.TypeAliasType.__value__], and as such Pydantic
+ wouldn't be able to have the alias stored as a JSON Schema definition.
from typing import Annotated
from pydantic import BaseModel, Field
A = Annotated[int, Field(alias="aa")]
type B = Annotated[int, Field(alias="bb")]
class M(BaseModel):
a: A
b: B
M.model_validate({"aa": 1, "bb": 2})
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
Option A — Upgrade to fixed release\npip install pydantic==2.11.0\nWhen NOT to use: This fix should not be used if backward compatibility with older Pydantic versions is required.\n\n
Why This Fix Works in Production
- Trigger: pydantic_core._pydantic_core.ValidationError: 1 validation error for M
- Mechanism: Field-specific metadata in PEP 695 type aliases is not handled correctly by Pydantic
- Why the fix works: Fixes the handling of field-specific metadata in PEP 695 type aliases, ensuring proper JSON Schema generation. (first fixed release: 2.11.0).
- If left unfixed, the same config can fail only in production (env differences), causing startup failures or partial feature outages.
Why This Breaks in Prod
- Field-specific metadata in PEP 695 type aliases is not handled correctly by Pydantic
- Surfaces as: pydantic_core._pydantic_core.ValidationError: 1 validation error for M
Proof / Evidence
- GitHub issue: #11552
- Fix PR: https://github.com/pydantic/pydantic/pull/11570
- First fixed release: 2.11.0
- Reproduced locally: No (not executed)
- Last verified: 2026-02-09
- Confidence: 0.85
- Did this fix it?: Yes (upstream fix exists)
- Own content ratio: 0.55
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“This is expected, see https://github.com/pydantic/pydantic/pull/11475 and the documentation that will be published in 2.11.”
“oh, that's disappointing”
“See https://github.com/pydantic/pydantic/issues/11467 for more context as well”
“I opened https://github.com/pydantic/pydantic/pull/11570.”
Failure Signature (Search String)
- pydantic_core._pydantic_core.ValidationError: 1 validation error for M
Error Message
Stack trace
Error Message
-------------
pydantic_core._pydantic_core.ValidationError: 1 validation error for M
b
Field required [type=missing, input_value={'aa': 1, 'bb': 2}, input_type=dict]
Minimal Reproduction
from typing import Annotated
from pydantic import BaseModel, Field
A = Annotated[int, Field(alias="aa")]
type B = Annotated[int, Field(alias="bb")]
class M(BaseModel):
a: A
b: B
M.model_validate({"aa": 1, "bb": 2})
Environment
- Pydantic: 2
What Broke
Validation errors occur when using PEP 695 type aliases with field-specific metadata.
Why It Broke
Field-specific metadata in PEP 695 type aliases is not handled correctly by Pydantic
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
pip install pydantic==2.11.0
Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.
Fix reference: https://github.com/pydantic/pydantic/pull/11570
First fixed release: 2.11.0
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- This fix should not be used if backward compatibility with older Pydantic versions is required.
Verify Fix
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
Did This Fix Work in Your Case?
Quick signal helps us prioritize which fixes to verify and improve.
Prevention
- Add a CI check that diffs key outputs after upgrades (OpenAPI schema snapshots, JSON payload shapes, CLI output).
- Upgrade behind a canary and run integration tests against the canary before 100% rollout.
Version Compatibility Table
| Version | Status |
|---|---|
| 2.11.0 | Fixed |
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.