arguments_v3_schema
Returns a schema that matches an arguments schema, e.g.:
from pydantic_core import SchemaValidator, core_schema
param_a = core_schema.arguments_v3_parameter(
name='a', schema=core_schema.str_schema(), mode='positional_only'
)
param_b = core_schema.arguments_v3_parameter(
name='kwargs', schema=core_schema.bool_schema(), mode='var_kwargs_uniform'
)
schema = core_schema.arguments_v3_schema([param_a, param_b])
v = SchemaValidator(schema)
assert v.validate_python({'a': 'hi', 'kwargs': {'b': True}}) == (('hi',), {'b': True})
This schema is currently not used by other Pydantic components. In V3, it will most likely
become the default arguments schema for the 'call' schema.
def arguments_v3_schema(
arguments: list[ArgumentsV3Parameter],
validate_by_name: bool | None = None,
validate_by_alias: bool | None = None,
extra_behavior: Literal['forbid', 'ignore'] | None = None,
ref: str | None = None,
metadata: dict[str, Any] | None = None,
serialization: SerSchema | None = None
) - > ArgumentsV3Schema
Returns a schema that matches an arguments schema. This schema is currently not used by other Pydantic components; in V3, it will most likely become the default arguments schema for the 'call' schema.
Parameters
| Name | Type | Description |
|---|---|---|
| arguments | list[ArgumentsV3Parameter] | The list of parameter definitions to use for the arguments schema |
| validate_by_name | `bool | None` = None |
| validate_by_alias | `bool | None` = None |
| extra_behavior | `Literal['forbid', 'ignore'] | None` = None |
| ref | `str | None` = None |
| metadata | `dict[str, Any] | None` = None |
| serialization | `SerSchema | None` = None |
Returns
| Type | Description |
|---|---|
ArgumentsV3Schema | A dictionary-based schema definition for validating function arguments in pydantic-core |