callable_schema
Returns a schema that checks if a value is callable, equivalent to python's callable method, e.g.:
from pydantic_core import SchemaValidator, core_schema
schema = core_schema.callable_schema()
v = SchemaValidator(schema)
v.validate_python(min)
def callable_schema(
ref: str | None = None,
metadata: dict[str, Any] | None = None,
serialization: SerSchema | None = None
) - > CallableSchema
Returns a schema that checks if a value is callable, equivalent to python's callable method.
Parameters
| Name | Type | Description |
|---|---|---|
| ref | `str | None` = None |
| metadata | `dict[str, Any] | None` = None |
| serialization | `SerSchema | None` = None |
Returns
| Type | Description |
|---|---|
CallableSchema | A schema object that validates whether an input value is a callable object. |