The Fix
pip install pydantic==2.11.0
Based on closed pydantic/pydantic issue #11467 · 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%.
@@ -250,7 +250,6 @@ By leveraging the new [`type` statement](https://typing.readthedocs.io/en/latest
from annotated_types import Gt
- from typing_extensions import TypeAliasType
from pydantic import BaseModel
from typing import Annotated
from pydantic import Field, BaseModel
type SomeAlias = Annotated[int, Field(description='number')]
class Model(BaseModel):
foo: Annotated[SomeAlias, Field(title='abc')]
print(Model.model_json_schema()) # description gets dropped
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 field-specific metadata in type aliases is required.\n\n
Why This Fix Works in Production
- Trigger: print(Model.model_json_schema()) # description gets dropped
- Mechanism: The JSON Schema generation incorrectly handled PEP 695 type aliases, leading to loss of field-specific metadata
- Why the fix works: Fixes the JSON Schema generation for referenceable core schemas holding JSON metadata, addressing issue #11467. (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
- The JSON Schema generation incorrectly handled PEP 695 type aliases, leading to loss of field-specific metadata
- Production symptom (often without a traceback): print(Model.model_json_schema()) # description gets dropped
Proof / Evidence
- GitHub issue: #11467
- Fix PR: https://github.com/pydantic/pydantic/pull/11475
- 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.62
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“PydanticAI Github Bot Found 1 issues similar to this one: 1. "https://github.com/pydantic/pydantic/issues/6352" (90% similar)”
“My comment as a user on another thread, was that I really want TypeAliasType to continue to mean "make this a top-level type definition in…”
“> My suggestion is to nail down some separations of responsibilities: > > - Fields are explicitly for attaching to a parent model*”
Failure Signature (Search String)
- print(Model.model_json_schema()) # description gets dropped
- So this works well, but it breaks the assumption that PEP 695 type aliases are referenceable, and so the following does not work as expected:
Copy-friendly signature
Failure Signature
-----------------
print(Model.model_json_schema()) # description gets dropped
So this works well, but it breaks the assumption that PEP 695 type aliases are referenceable, and so the following does not work as expected:
Error Message
Signature-only (no traceback captured)
Error Message
-------------
print(Model.model_json_schema()) # description gets dropped
So this works well, but it breaks the assumption that PEP 695 type aliases are referenceable, and so the following does not work as expected:
Minimal Reproduction
from typing import Annotated
from pydantic import Field, BaseModel
type SomeAlias = Annotated[int, Field(description='number')]
class Model(BaseModel):
foo: Annotated[SomeAlias, Field(title='abc')]
print(Model.model_json_schema()) # description gets dropped
What Broke
JSON Schema generated for models lost important metadata, causing incorrect schema representation.
Why It Broke
The JSON Schema generation incorrectly handled PEP 695 type aliases, leading to loss of field-specific metadata
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/11475
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 field-specific metadata in type aliases 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.