@@ -1500,13 +1500,13 @@ def __call__(self, __input_value: Any, __info: ModelFieldValidationInfo) -> Any:
1500
1500
1501
1501
1502
1502
class ModelFieldValidatorFunctionSchema (TypedDict ):
1503
- call : Required [ModelFieldValidatorFunction ]
1504
1503
type : Literal ['method' ]
1504
+ call : ModelFieldValidatorFunction
1505
1505
1506
1506
1507
1507
class ValidatorFunctionSchema (TypedDict ):
1508
- call : Required [ValidatorFunction ]
1509
1508
type : Literal ['function' ]
1509
+ call : ValidatorFunction
1510
1510
1511
1511
1512
1512
class FunctionSchema (TypedDict , total = False ):
@@ -1519,7 +1519,7 @@ class FunctionSchema(TypedDict, total=False):
1519
1519
serialization : SerSchema
1520
1520
1521
1521
1522
- def model_field_function_before_schema (
1522
+ def method_before_schema (
1523
1523
function : ModelFieldValidatorFunction ,
1524
1524
schema : CoreSchema ,
1525
1525
* ,
@@ -1538,7 +1538,7 @@ def fn(v: bytes, info: core_schema.ModelFieldValidationInfo) -> str:
1538
1538
assert info.field_name is not None
1539
1539
return v.decode() + 'world'
1540
1540
1541
- func_schema = core_schema.model_field_function_before_schema (function=fn, schema=core_schema.str_schema())
1541
+ func_schema = core_schema.method_before_schema (function=fn, schema=core_schema.str_schema())
1542
1542
schema = core_schema.typed_dict_schema(
1543
1543
{'a': core_schema.typed_dict_field(func_schema)}
1544
1544
)
@@ -1715,13 +1715,13 @@ def __call__(
1715
1715
1716
1716
1717
1717
class ModelFieldWrapValidatorFunctionSchema (TypedDict ):
1718
- call : Required [ModelFieldWrapValidatorFunction ]
1719
1718
type : Literal ['method' ]
1719
+ call : ModelFieldWrapValidatorFunction
1720
1720
1721
1721
1722
1722
class WrapValidatorFunctionSchema (TypedDict ):
1723
- call : Required [WrapValidatorFunction ]
1724
1723
type : Literal ['function' ]
1724
+ call : WrapValidatorFunction
1725
1725
1726
1726
1727
1727
class FunctionWrapSchema (TypedDict , total = False ):
@@ -1776,7 +1776,7 @@ def fn(v: str, validator: core_schema.CallableValidator, info: core_schema.Valid
1776
1776
)
1777
1777
1778
1778
1779
- def model_field_function_wrap_schema (
1779
+ def method_wrap_schema (
1780
1780
function : ModelFieldWrapValidatorFunction ,
1781
1781
schema : CoreSchema ,
1782
1782
* ,
@@ -1797,7 +1797,7 @@ def fn(v: bytes, validator: core_schema.CallableValidator, info: core_schema.Mod
1797
1797
assert info.field_name is not None
1798
1798
return validator(v) + 'world'
1799
1799
1800
- func_schema = core_schema.model_field_function_wrap_schema (function=fn, schema=core_schema.str_schema())
1800
+ func_schema = core_schema.method_wrap_schema (function=fn, schema=core_schema.str_schema())
1801
1801
schema = core_schema.typed_dict_schema(
1802
1802
{'a': core_schema.typed_dict_field(func_schema)}
1803
1803
)
0 commit comments