Jump to solution
Verify

The Fix

pip install pydantic==2.11.0

Based on closed pydantic/pydantic issue #11624 · PR/commit linked

Jump to Verify Open PR/Commit
@@ -405,7 +405,7 @@ def _apply_parse( if tp is _FieldTypeMarker: - return handler(source_type) + return cs.chain_schema([s, handler(source_type)]) if s else handler(source_type)
repro.py
class MyDict(TypedDict): a: Annotated[float, validate_as(str).transform(lambda v: v.split()[0]).validate_as(...)] b: Annotated[float, validate_as(str).transform(lambda v: v.split()[0]).validate_as(float)] TypeAdapter(MyDict).validate_python({"a": "12 ab", "b": "12 ab"})
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==2.11.0\nWhen NOT to use: Do not use this fix if the validation logic relies on the original input type.\n\n

Why This Fix Works in Production

  • Trigger: validate_as(...) doesn't chain correctly
  • Mechanism: The ellipsis in the pipeline API did not preserve other validation steps
  • Why the fix works: Preserves other steps when using the ellipsis in the pipeline API, addressing the issue where `...` did not chain correctly. (first fixed release: 2.11.0).
Production impact:
  • If left unfixed, this can cause silent data inconsistencies that propagate (bad cache entries, incorrect downstream decisions).

Why This Breaks in Prod

  • Shows up under Python 3.9 in real deployments (not just unit tests).
  • The ellipsis in the pipeline API did not preserve other validation steps
  • Production symptom (often without a traceback): validate_as(...) doesn't chain correctly

Proof / Evidence

Discussion

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

“### Initial Checks - [x] I confirm that I'm using Pydantic V2 ### Description My reading of the docs is that ... should do the same thing as specifying the same type as the annotation. In reality it seems to validate the type against the or”
Issue thread · issue description · source

Failure Signature (Search String)

  • validate_as(...) doesn't chain correctly
  • In the below example, both a and b should produce the same result and validate correctly. Currently, a fails validation.
Copy-friendly signature
signature.txt
Failure Signature ----------------- validate_as(...) doesn't chain correctly In the below example, both a and b should produce the same result and validate correctly. Currently, a fails validation.

Error Message

Signature-only (no traceback captured)
error.txt
Error Message ------------- validate_as(...) doesn't chain correctly In the below example, both a and b should produce the same result and validate correctly. Currently, a fails validation.

Minimal Reproduction

repro.py
class MyDict(TypedDict): a: Annotated[float, validate_as(str).transform(lambda v: v.split()[0]).validate_as(...)] b: Annotated[float, validate_as(str).transform(lambda v: v.split()[0]).validate_as(float)] TypeAdapter(MyDict).validate_python({"a": "12 ab", "b": "12 ab"})

Environment

  • Python: 3.9
  • Pydantic: 2

What Broke

Validation fails for input that should pass, causing incorrect data handling.

Why It Broke

The ellipsis in the pipeline API did not preserve other validation steps

Fix Options (Details)

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

pip install pydantic==2.11.0

When NOT to use: Do not use this fix if the validation logic relies on the original input type.

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/11626

First fixed release: 2.11.0

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 the validation logic relies on the original input type.

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.11.0 Fixed

Related Issues

No related fixes found.

Sources

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