Jump to solution
Verify

The Fix

pip install pydantic==2.12.0

Based on closed pydantic/pydantic issue #11962 · 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
@@ -169,7 +169,7 @@ VALIDATE_CALL_SUPPORTED_TYPES = get_args(ValidateCallSupportedTypes) -UNSUPPORTED_STANDALONE_FIELDINFO_ATTRIBUTES = [ +UNSUPPORTED_STANDALONE_FIELDINFO_ATTRIBUTES: list[tuple[str, Any]] = [ ('alias', None),
repro.py
from pydantic import Field, ValidationError, validate_call, ConfigDict from typing import Annotated @validate_call def how_many(num: Annotated[int, Field(gt=10)]): return num try: print(how_many(number = 20)) print('alias test 1 failed') except Exception as e: print('alias test 1 passed') @validate_call def how_many(num: Annotated[int, Field(gt=10, alias = 'number')]): return num try: print(how_many(number = 20)) except Exception as e: print(f'alias test 2 : {e}') @validate_call def how_many(num: Annotated[int, Field(gt=10, validation_alias = 'number')]): return num try: print(how_many(number = 20)) except Exception as e: print(f'validation_alias test 1 : {e}') @validate_call(config = ConfigDict(validate_by_alias = True)) def how_many(num: Annotated[int, Field(gt=10, validation_alias = 'number')]): return num try: print(how_many(number = 20)) except Exception as e: print(f'validation_alias test 2 : {e}')
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.12.0\nWhen NOT to use: This fix is not applicable if validate_call is not used with validation_alias.\n\n

Why This Fix Works in Production

  • Trigger: validate_by_alias does not work with validate_call
  • Mechanism: The validate_call decorator does not recognize the validate_by_alias setting
  • Why the fix works: Respects the `validation_alias` in the `@validate_call` decorator, addressing the issue where `validate_by_alias` did not function as expected. (first fixed release: 2.12.0).
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

  • The validate_call decorator does not recognize the validate_by_alias setting
  • Production symptom (often without a traceback): validate_by_alias does not work with validate_call

Proof / Evidence

Verified Execution

We executed the runnable minimal repro in a temporary environment and captured exit codes + logs.

  • Status: PASS
  • Ran: 2026-02-11T16:52:29Z
  • Package: pydantic
  • Fixed: 2.12.0
  • Mode: fixed_only
  • Outcome: ok
Logs
affected (exit=None)
fixed (exit=0)
alias test 1 passed 20 20 20

Discussion

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

“yup , agree with that”
@mg3146 · 2025-06-20 · source

Failure Signature (Search String)

  • validate_by_alias does not work with validate_call
  • does validate_by_alias work with validate_call() ? I'm getting a validation error in the below code snippet. My ultimate goal was to use `AliasChoices ` so that I could do a many
Copy-friendly signature
signature.txt
Failure Signature ----------------- validate_by_alias does not work with validate_call does validate_by_alias work with validate_call() ? I'm getting a validation error in the below code snippet. My ultimate goal was to use `AliasChoices ` so that I could do a many : 1 mapping of a keyword argument.

Error Message

Signature-only (no traceback captured)
error.txt
Error Message ------------- validate_by_alias does not work with validate_call does validate_by_alias work with validate_call() ? I'm getting a validation error in the below code snippet. My ultimate goal was to use `AliasChoices ` so that I could do a many : 1 mapping of a keyword argument.

Minimal Reproduction

repro.py
from pydantic import Field, ValidationError, validate_call, ConfigDict from typing import Annotated @validate_call def how_many(num: Annotated[int, Field(gt=10)]): return num try: print(how_many(number = 20)) print('alias test 1 failed') except Exception as e: print('alias test 1 passed') @validate_call def how_many(num: Annotated[int, Field(gt=10, alias = 'number')]): return num try: print(how_many(number = 20)) except Exception as e: print(f'alias test 2 : {e}') @validate_call def how_many(num: Annotated[int, Field(gt=10, validation_alias = 'number')]): return num try: print(how_many(number = 20)) except Exception as e: print(f'validation_alias test 1 : {e}') @validate_call(config = ConfigDict(validate_by_alias = True)) def how_many(num: Annotated[int, Field(gt=10, validation_alias = 'number')]): return num try: print(how_many(number = 20)) except Exception as e: print(f'validation_alias test 2 : {e}')

Environment

  • Pydantic: 2

What Broke

Validation errors occur when using aliases in function parameters.

Why It Broke

The validate_call decorator does not recognize the validate_by_alias setting

Fix Options (Details)

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

pip install pydantic==2.12.0

When NOT to use: This fix is not applicable if validate_call is not used with validation_alias.

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

First fixed release: 2.12.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

  • This fix is not applicable if validate_call is not used with validation_alias.

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

Related Issues

No related fixes found.

Sources

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