Jump to solution
Details

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.

Open PR/Commit
@@ -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]}
fix.md
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).
Production impact:
  • 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

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) :).”
@sydney-runkle · 2024-03-27 · confirmation · source
“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 :)”
@sydney-runkle · 2024-03-19 · source

Failure Signature (Search String)

  • - [x] Enum validation performance improvements (@samuelcolvin)
  • - [ ] New `pydantic-core` release (with 🚀 awesome ⭐ pyo3 changes)
Copy-friendly signature
signature.txt
Failure Signature ----------------- - [x] Enum validation performance improvements (@samuelcolvin) - [ ] New `pydantic-core` release (with 🚀 awesome ⭐ pyo3 changes)

Error Message

Signature-only (no traceback captured)
error.txt
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

When NOT to use: Do not use this fix if backward compatibility with existing schemas is required.

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.

Get updates

We publish verified fixes weekly. No spam.

Subscribe

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

VersionStatus
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.