The Fix
pip install pydantic==1.10.17
Based on closed pydantic/pydantic issue #9678 · 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%.
@@ -145,10 +145,8 @@ print(user.model_dump(by_alias=True)) # (2)!
over `alias` for serialization.
- You may also set `alias_priority` on a field to change this behavior.
-
- You can read more about [Alias Precedence](../concepts/alias.md#alias-precedence) in the
from pydantic import BaseModel, Field
class Model(BaseModel):
first_name: str = Field(
alias="firstName",
validation_alias="FIRST_NAME",
serialization_alias="f_name",
alias_priority=1
)
model = Model(firstName="Pippo") # ValidationError, no way to tweak alias_priority to be able to validate via plain_alias
print(model.model_dump())
print(model.model_dump(by_alias=True)) # Serialization via serialization_alias only
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==1.10.17\nWhen NOT to use: This fix is not applicable if the documentation is already accurate regarding alias_priority usage.\n\n
Why This Fix Works in Production
- Trigger: [docs]: cannot leverage on alias_priority if alias_generator is not involved
- Mechanism: Documentation incorrectly suggested that alias_priority can be used without an AliasGenerator
- Why the fix works: Updated documentation to clarify the use of alias_priority with alias_generator in Pydantic. (first fixed release: 1.10.17).
- 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
- Documentation incorrectly suggested that alias_priority can be used without an AliasGenerator
- Production symptom (often without a traceback): [docs]: cannot leverage on alias_priority if alias_generator is not involved
Proof / Evidence
- GitHub issue: #9678
- Fix PR: https://github.com/pydantic/pydantic/pull/9684
- First fixed release: 1.10.17
- 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.52
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“@AlessandroMiola, Great catch. This is definitely wrong. I'll open a fix in a sec.”
Failure Signature (Search String)
- [docs]: cannot leverage on alias_priority if alias_generator is not involved
- I would like to point out a possible (I apologize if this is not the case and I'm missing something) inconsistency in the documentation at
Copy-friendly signature
Failure Signature
-----------------
[docs]: cannot leverage on alias_priority if alias_generator is not involved
I would like to point out a possible (I apologize if this is not the case and I'm missing something) inconsistency in the documentation at https://docs.pydantic.dev/latest/concepts/fields/#field-aliases, where the note specifies that
Error Message
Signature-only (no traceback captured)
Error Message
-------------
[docs]: cannot leverage on alias_priority if alias_generator is not involved
I would like to point out a possible (I apologize if this is not the case and I'm missing something) inconsistency in the documentation at https://docs.pydantic.dev/latest/concepts/fields/#field-aliases, where the note specifies that
Minimal Reproduction
from pydantic import BaseModel, Field
class Model(BaseModel):
first_name: str = Field(
alias="firstName",
validation_alias="FIRST_NAME",
serialization_alias="f_name",
alias_priority=1
)
model = Model(firstName="Pippo") # ValidationError, no way to tweak alias_priority to be able to validate via plain_alias
print(model.model_dump())
print(model.model_dump(by_alias=True)) # Serialization via serialization_alias only
Environment
- Pydantic: 2
What Broke
Users were misled about the functionality of alias_priority, causing confusion in implementation.
Why It Broke
Documentation incorrectly suggested that alias_priority can be used without an AliasGenerator
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
pip install pydantic==1.10.17
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/9684
First fixed release: 1.10.17
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- This fix is not applicable if the documentation is already accurate regarding alias_priority usage.
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 |
|---|---|
| 1.10.17 | Fixed |
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.