The Fix
pip install pydantic==1.10.15
Based on closed pydantic/pydantic issue #8993 · PR/commit linked
Production note: Watch p95/p99 latency and retry volume; timeouts can turn into retry storms and duplicate side-effects.
@@ -732,24 +732,22 @@ def literal_schema(self, schema: core_schema.LiteralSchema) -> JsonSchemaValue:
expected = [to_jsonable_python(v) for v in expected]
+ result: dict[str, Any] = {'enum': expected}
if len(expected) == 1:
- return {'const': expected[0]}
Option A — Upgrade to fixed release\npip install pydantic==1.10.15\nWhen NOT to use: Do not use this fix if backward compatibility with existing schemas is required.\n\n
Why This Fix Works in Production
- Trigger: - [x] Enum validation performance improvements (@samuelcolvin)
- Mechanism: This fix adds enum and type to the JSON schema for single item literals
- Why the fix works: Adds enum and type to the JSON schema for single item literals, addressing related issues. (first fixed release: 1.10.15).
- If left unfixed, tail latency can spike under load and surface as timeouts/retries (amplifying incident impact).
Why This Breaks in Prod
- This fix adds enum and type to the JSON schema for single item literals
- Production symptom (often without a traceback): - [x] Enum validation performance improvements (@samuelcolvin)
Proof / Evidence
- GitHub issue: #8993
- Fix PR: https://github.com/pydantic/pydantic/pull/8944
- First fixed release: 1.10.15
- 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.69
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“Closing for now - we've addressed all of these issues. We're on target for a release late this week (or early next) :).”
“Update, based on the current status of our TODOs - we're looking at releasing v2.7.0b1 by the end of March, hopefully next week :)”
Failure Signature (Search String)
- - [x] Enum validation performance improvements (@samuelcolvin)
- - [ ] New `pydantic-core` release (with 🚀 awesome ⭐ pyo3 changes)
Copy-friendly signature
Failure Signature
-----------------
- [x] Enum validation performance improvements (@samuelcolvin)
- [ ] New `pydantic-core` release (with 🚀 awesome ⭐ pyo3 changes)
Error Message
Signature-only (no traceback captured)
Error Message
-------------
- [x] Enum validation performance improvements (@samuelcolvin)
- [ ] New `pydantic-core` release (with 🚀 awesome ⭐ pyo3 changes)
What Broke
Potential incorrect JSON schema generation for single item literals leading to validation issues.
Why It Broke
This fix adds enum and type to the JSON schema for single item literals
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
pip install pydantic==1.10.15
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/8944
First fixed release: 1.10.15
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- Do not use this fix if backward compatibility with existing schemas is required.
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.15 | Fixed |
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.