The Fix
pip install pydantic==2.6.2
Based on closed pydantic/pydantic issue #8780 · 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%.
@@ -402,6 +402,13 @@ def merge_field_infos(*field_infos: FieldInfo, **overrides: Any) -> FieldInfo:
field_info = copy(field_infos[0])
field_info._attributes_set.update(overrides)
+
+ default_override = overrides.pop('default', PydanticUndefined)
+ if default_override is Ellipsis:
from typing import Annotated
from pydantic import Field, create_model
Model = create_model(
'test_model',
foo=(int, ...),
bar=(Annotated[int, Field(description="Bar description")], ...),
baz=(Annotated[int, Field(..., description="Baz description")], ...),
)
Model.model_json_schema()
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.6.2\nWhen NOT to use: Do not use if it changes public behavior or if the failure cannot be reproduced.\n\n
Why This Fix Works in Production
- Trigger: model_json_schema export with Annotated types misses 'required' parameters
- Mechanism: The model_json_schema did not recognize fields annotated with FieldInfo and Ellipsis as required
- Why the fix works: Fixes the issue where using model_json_schema with Annotated types did not mark them as required. (first fixed release: 2.6.2).
- 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
- Shows up under Python 3.11 in real deployments (not just unit tests).
- The model_json_schema did not recognize fields annotated with FieldInfo and Ellipsis as required
- Production symptom (often without a traceback): model_json_schema export with Annotated types misses 'required' parameters
Proof / Evidence
- GitHub issue: #8780
- Fix PR: https://github.com/pydantic/pydantic/pull/8793
- First fixed release: 2.6.2
- 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.61
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“Indeed, a related issue is here: https://github.com/pydantic/pydantic/issues/8534”
Failure Signature (Search String)
- model_json_schema export with Annotated types misses 'required' parameters
- It seems that using `model_json_schema` on type annotations combining `typing.Annotated` and `pydantic.Field` result in the `Annotated` not being marked as `required`.
Copy-friendly signature
Failure Signature
-----------------
model_json_schema export with Annotated types misses 'required' parameters
It seems that using `model_json_schema` on type annotations combining `typing.Annotated` and `pydantic.Field` result in the `Annotated` not being marked as `required`.
Error Message
Signature-only (no traceback captured)
Error Message
-------------
model_json_schema export with Annotated types misses 'required' parameters
It seems that using `model_json_schema` on type annotations combining `typing.Annotated` and `pydantic.Field` result in the `Annotated` not being marked as `required`.
Minimal Reproduction
from typing import Annotated
from pydantic import Field, create_model
Model = create_model(
'test_model',
foo=(int, ...),
bar=(Annotated[int, Field(description="Bar description")], ...),
baz=(Annotated[int, Field(..., description="Baz description")], ...),
)
Model.model_json_schema()
Environment
- Python: 3.11
- Pydantic: 2
What Broke
JSON schema output incorrectly marked required fields, leading to potential validation issues.
Why It Broke
The model_json_schema did not recognize fields annotated with FieldInfo and Ellipsis as required
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
pip install pydantic==2.6.2
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/8793
First fixed release: 2.6.2
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- Do not use if it changes public behavior or if the failure cannot be reproduced.
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.6.2 | Fixed |
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.