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%.
@@ -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.
from pydantic import validate_call
class A:
def __call__(self, *args: Any, **kwds: Any) -> Any:
pass
validate_call(A) # error
validate_call(A()) # error
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
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).
- 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
- GitHub issue: #10461
- Fix PR: https://github.com/pydantic/pydantic/pull/10627
- First fixed release: 1.10.19
- Reproduced locally: No (not executed)
- Last verified: 2026-02-09
- Confidence: 0.95
- Did this fix it?: Yes (upstream fix exists)
- Own content ratio: 0.45
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.”
“Some decorators return functors (classes with __call__), validating such callables is my use case.”
“I don't know if we should support these use cases”
“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…”
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 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 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
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
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.
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
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
| Version | Status |
|---|---|
| 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.