Jump to solution
Verify

The Fix

pip install pydantic==1.10.1

Based on closed pydantic/pydantic issue #9559 · 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%.

Jump to Verify Open PR/Commit
@@ -34,7 +34,7 @@ A few notes: Type coercion like this can be extremely helpful but also confusing or not desired, -see [below](#coercion-and-stictness) for a discussion of `validate_arguments`'s limitations in this regard. +see [below](#coercion-and-strictness) for a discussion of `validate_arguments`'s limitations in this regard.
repro.py
from enum import Enum from decimal import Decimal from pydantic import BaseModel class EnumClass(Enum): enum_value = 1 class ModelClass(BaseModel): enum_field: EnumClass validated_class = ModelClass.model_validate({"enum_field": Decimal(1)}) print(validated_class.enum_field) # 2.4.2 - Prints "EnumClass.enum_value" # 2.7.2 - Returns Validation Error: # pydantic_core._pydantic_core.ValidationError: 1 validation error for ModelClass # enum_field # Input should be 1 [type=enum, input_value=Decimal('1'), input_type=Decimal] # For further information visit https://errors.pydantic.dev/2.7/v/enum
verify
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
fix.md
Option A — Upgrade to fixed release\npip install pydantic==1.10.1\nWhen NOT to use: This fix should not be applied if the application relies on the previous validation behavior.\n\nOption B — Safe version pin\npip install pydantic==2.4.2\nWhen NOT to use: Do not use if you need features or security fixes in newer releases.\n\n

Why This Fix Works in Production

  • Trigger: Validation of Enum Field with Decimal Fails
  • Mechanism: Fixed a typo in the documentation regarding type coercion and strictness.
  • Why the fix works: Fixed a typo in the documentation regarding type coercion and strictness. (first fixed release: 1.10.1).
Production impact:
  • 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.10 in real deployments (not just unit tests).
  • Production symptom (often without a traceback): Validation of Enum Field with Decimal Fails

Proof / Evidence

Discussion

High-signal excerpts from the issue thread (symptoms, repros, edge-cases).

“Might even get a fix out in a patch release - will keep you updated. Likely an issue in pydantic-core.”
@sydney-runkle · 2024-06-04 · source
“I think it's not just related to Decimal, but any type which can compare equal with the enum members. For example, here's a custom class…”
@davidhewitt · 2024-06-11 · source
“Hey @jroy-sophos, Thanks for your inquiry! I believe we'll be working on some enum validator fixes in v2.10 in September. I'll keep you updated on…”
@sydney-runkle · 2024-08-14 · source
“@jroy-sophos, Thanks for reporting this. Looks like probably an issue related to our enum validation changes in 2.7. I'll work on a fix for this…”
@sydney-runkle · 2024-06-04 · source

Failure Signature (Search String)

  • Validation of Enum Field with Decimal Fails
  • Thanks for reporting this. Looks like probably an issue related to our `enum` validation changes in 2.7.
Copy-friendly signature
signature.txt
Failure Signature ----------------- Validation of Enum Field with Decimal Fails Thanks for reporting this. Looks like probably an issue related to our `enum` validation changes in 2.7.

Error Message

Signature-only (no traceback captured)
error.txt
Error Message ------------- Validation of Enum Field with Decimal Fails Thanks for reporting this. Looks like probably an issue related to our `enum` validation changes in 2.7.

Minimal Reproduction

repro.py
from enum import Enum from decimal import Decimal from pydantic import BaseModel class EnumClass(Enum): enum_value = 1 class ModelClass(BaseModel): enum_field: EnumClass validated_class = ModelClass.model_validate({"enum_field": Decimal(1)}) print(validated_class.enum_field) # 2.4.2 - Prints "EnumClass.enum_value" # 2.7.2 - Returns Validation Error: # pydantic_core._pydantic_core.ValidationError: 1 validation error for ModelClass # enum_field # Input should be 1 [type=enum, input_value=Decimal('1'), input_type=Decimal] # For further information visit https://errors.pydantic.dev/2.7/v/enum

Environment

  • Python: 3.10
  • Pydantic: 2

What Broke

Validation errors occur when using Decimal with Enum fields, leading to application crashes.

Fix Options (Details)

Option A — Upgrade to fixed release Safe default (recommended)

pip install pydantic==1.10.1

When NOT to use: This fix should not be applied if the application relies on the previous validation behavior.

Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.

Option B — Safe version pin Backward-compatible pin

pip install pydantic==2.4.2

When NOT to use: Do not use if you need features or security fixes in newer releases.

Use when you can’t upgrade immediately. Plan a follow-up to upgrade (pins can accumulate security/compat debt).

Fix reference: https://github.com/pydantic/pydantic-core/pull/1456

First fixed release: 1.10.1

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

  • This fix should not be applied if the application relies on the previous validation behavior.
  • Do not use if you need features or security fixes in newer releases.

Verify Fix

verify
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

VersionStatus
2.4.2 Working
1.10.1 Fixed

Related Issues

No related fixes found.

Sources

We don’t republish the full GitHub discussion text. Use the links above for context.