The Fix
pip install pydantic==2.9.1
Based on closed pydantic/pydantic issue #9567 · PR/commit linked
@@ -1057,6 +1057,10 @@ print(type(Meal(dessert={'kind': 'cake'}).dessert).__name__)
Allows any value, including `None`.
+## [`typing.Hashable`][]
+
+* From Python, supports any data that passes an `isinstance(v, Hashable)` check.
from typing import Hashable
from pydantic import BaseModel
class A(BaseModel):
x: Hashable
a = A.model_validate_json('{"x": "1"}')
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.9.1\nWhen NOT to use: Do not use this fix if your application relies on non-hashable types being validated.\n\n
Why This Fix Works in Production
- Trigger: `model_validate_json` cannot validate `Hashable`
- Mechanism: The validation for Hashable types in JSON was not implemented in the library
- Why the fix works: Adds support for validating `Hashable` types in JSON, addressing the issue reported in #9567. (first fixed release: 2.9.1).
Why This Breaks in Prod
- The validation for Hashable types in JSON was not implemented in the library
- Production symptom (often without a traceback): `model_validate_json` cannot validate `Hashable`
Proof / Evidence
- GitHub issue: #9567
- Fix PR: https://github.com/pydantic/pydantic/pull/10324
- First fixed release: 2.9.1
- 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.71
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“@uf-fipper, Thanks for the report, looks like a bug (or maybe a feature request, not sure if we ever supported this).”
Failure Signature (Search String)
- `model_validate_json` cannot validate `Hashable`
Copy-friendly signature
Failure Signature
-----------------
`model_validate_json` cannot validate `Hashable`
Error Message
Signature-only (no traceback captured)
Error Message
-------------
`model_validate_json` cannot validate `Hashable`
Minimal Reproduction
from typing import Hashable
from pydantic import BaseModel
class A(BaseModel):
x: Hashable
a = A.model_validate_json('{"x": "1"}')
Environment
- Pydantic: 2
What Broke
Users experienced validation errors when trying to validate Hashable types in JSON.
Why It Broke
The validation for Hashable types in JSON was not implemented in the library
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
pip install pydantic==2.9.1
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/10324
First fixed release: 2.9.1
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- Do not use this fix if your application relies on non-hashable types being validated.
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.9.1 | Fixed |
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.