Jump to solution
Verify

The Fix

pip install pydantic==1.10.19

Based on closed pydantic/pydantic issue #10461 · 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
@@ -1186,6 +1186,103 @@ except PydanticUserError as exc_info: ``` +## Unsupported type for `validate_call` {#validate-call-type} + +`validate_call` has some limitations on the callables it can validate. This error is raised when you try to use it with an unsupported callable. Currently the supported callables are functions (including lambdas) and methods and instances of [`partial`][functools.partial]. In the case of [`partial`][functools.partial], the function being partially applied must be one of the supported callables.
repro.py
from pydantic import validate_call class A: def __call__(self, *args: Any, **kwds: Any) -> Any: pass validate_call(A) # error validate_call(A()) # error
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.19\nWhen NOT to use: This fix should not be used if the callable does not conform to the supported types for `validate_call`.\n\n

Why This Fix Works in Production

  • Trigger: pydantic.errors.PydanticSchemaGenerationError: Unable to generate pydantic-core schema for <class '__main__.A'>. Set `arbitrary_types_allowed=True` in the…
  • Mechanism: The `validate_call` function does not support class or custom callables due to type validation limitations
  • Why the fix works: Adds runtime validation for the `@validate_call` callable argument, addressing issues with class and custom callables. (first fixed release: 1.10.19).
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` function does not support class or custom callables due to type validation limitations
  • Surfaces as: pydantic.errors.PydanticSchemaGenerationError: Unable to generate pydantic-core schema for <class '__main__.A'>. Set `arbitrary_types_allowed=True` in the model_config to ignore…

Proof / Evidence

Discussion

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

“If we were to support one, I'd support type(A).__call__, but I agree with your analysis above.”
@sydney-runkle · 2024-09-25 · source
“Some decorators return functors (classes with __call__), validating such callables is my use case.”
@pycaw · 2025-06-09 · source
“I don't know if we should support these use cases”
@Viicos · 2024-09-25 · source
“To my understanding (I am not a CPython expert though), __new__ and __init__ are just special functions called by type.__call__, so type(A).__call__ should be more…”
@kc0506 · 2024-09-25 · source

Failure Signature (Search String)

  • pydantic.errors.PydanticSchemaGenerationError: Unable to generate pydantic-core schema for <class '__main__.A'>. Set `arbitrary_types_allowed=True` in the model_config to ignore

Error Message

Stack trace
error.txt
Error Message ------------- pydantic.errors.PydanticSchemaGenerationError: Unable to generate pydantic-core schema for <class '__main__.A'>. Set `arbitrary_types_allowed=True` in the model_config to ignore this error or implement `__get_pydantic_core_schema__` on your type to fully support it. If you got this error by calling handler(<some type>) within `__get_pydantic_core_schema__` then you likely need to call `handler.generate_schema(<some type>)` since we do not call `__get_pydantic_core_schema__` on `<some type>` otherwise to avoid infinite recursion. For further information visit https://errors.pydantic.dev/2.10/u/schema-for-unknown-type
Stack trace
error.txt
Error Message ------------- File "C:\Users\kchon\OneDrive\Desktop\pydantic\pydantic\_internal\_validate_call.py", line 41, in __init__ self.__name__ = function.__name__ ^^^^^^^^^^^^^^^^^ AttributeError: 'A' object has no attribute '__name__'. Did you mean: '__ne__'?

Minimal Reproduction

repro.py
from pydantic import validate_call class A: def __call__(self, *args: Any, **kwds: Any) -> Any: pass validate_call(A) # error validate_call(A()) # error

Environment

  • Pydantic: 2

What Broke

Users encounter errors when using `validate_call` with class instances or custom callables, leading to validation failures.

Why It Broke

The `validate_call` function does not support class or custom callables due to type validation limitations

Fix Options (Details)

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

pip install pydantic==1.10.19

When NOT to use: This fix should not be used if the callable does not conform to the supported types for `validate_call`.

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

First fixed release: 1.10.19

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 used if the callable does not conform to the supported types for `validate_call`.

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
1.10.19 Fixed

Related Issues

No related fixes found.

Sources

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