diff --git a/pydantic_extra_types/country.py b/pydantic_extra_types/country.py index c930db1f..a32fa60a 100644 --- a/pydantic_extra_types/country.py +++ b/pydantic_extra_types/country.py @@ -95,7 +95,7 @@ def _validate(cls, __input_value: str, _: core_schema.ValidationInfo) -> Country def __get_pydantic_core_schema__( cls, source: type[Any], handler: GetCoreSchemaHandler ) -> core_schema.AfterValidatorFunctionSchema: - return core_schema.general_after_validator_function( + return core_schema.with_info_after_validator_function( cls._validate, core_schema.str_schema(to_upper=True), ) @@ -158,7 +158,7 @@ def _validate(cls, __input_value: str, _: core_schema.ValidationInfo) -> Country def __get_pydantic_core_schema__( cls, source: type[Any], handler: GetCoreSchemaHandler ) -> core_schema.AfterValidatorFunctionSchema: - return core_schema.general_after_validator_function( + return core_schema.with_info_after_validator_function( cls._validate, core_schema.str_schema(to_upper=True), serialization=core_schema.to_string_ser_schema(), @@ -222,7 +222,7 @@ def _validate(cls, __input_value: str, _: core_schema.ValidationInfo) -> Country def __get_pydantic_core_schema__( cls, source: type[Any], handler: GetCoreSchemaHandler ) -> core_schema.AfterValidatorFunctionSchema: - return core_schema.general_after_validator_function( + return core_schema.with_info_after_validator_function( cls._validate, core_schema.str_schema(to_upper=True), serialization=core_schema.to_string_ser_schema(), @@ -285,7 +285,7 @@ def _validate(cls, __input_value: str, _: core_schema.ValidationInfo) -> Country def __get_pydantic_core_schema__( cls, source: type[Any], handler: GetCoreSchemaHandler ) -> core_schema.AfterValidatorFunctionSchema: - return core_schema.general_after_validator_function( + return core_schema.with_info_after_validator_function( cls._validate, core_schema.str_schema(), serialization=core_schema.to_string_ser_schema(), @@ -340,7 +340,7 @@ def _validate(cls, __input_value: str, _: core_schema.ValidationInfo) -> Country def __get_pydantic_core_schema__( cls, source: type[Any], handler: GetCoreSchemaHandler ) -> core_schema.AfterValidatorFunctionSchema: - return core_schema.general_after_validator_function( + return core_schema.with_info_after_validator_function( cls._validate, core_schema.str_schema(), serialization=core_schema.to_string_ser_schema(), diff --git a/pydantic_extra_types/payment.py b/pydantic_extra_types/payment.py index a3bfa73a..c451aab0 100644 --- a/pydantic_extra_types/payment.py +++ b/pydantic_extra_types/payment.py @@ -52,7 +52,7 @@ def __init__(self, card_number: str): @classmethod def __get_pydantic_core_schema__(cls, source: type[Any], handler: GetCoreSchemaHandler) -> core_schema.CoreSchema: - return core_schema.general_after_validator_function( + return core_schema.with_info_after_validator_function( cls.validate, core_schema.str_schema( min_length=cls.min_length, max_length=cls.max_length, strip_whitespace=cls.strip_whitespace diff --git a/pydantic_extra_types/phone_numbers.py b/pydantic_extra_types/phone_numbers.py index 4c25e452..424bc1ae 100644 --- a/pydantic_extra_types/phone_numbers.py +++ b/pydantic_extra_types/phone_numbers.py @@ -43,7 +43,7 @@ class PhoneNumber(str): @classmethod def __get_pydantic_core_schema__(cls, source: type[Any], handler: GetCoreSchemaHandler) -> core_schema.CoreSchema: - return core_schema.general_after_validator_function( + return core_schema.with_info_after_validator_function( cls._validate, core_schema.str_schema(min_length=cls.min_length, max_length=cls.max_length), ) diff --git a/pydantic_extra_types/routing_number.py b/pydantic_extra_types/routing_number.py index e2b083a9..22ea6e88 100644 --- a/pydantic_extra_types/routing_number.py +++ b/pydantic_extra_types/routing_number.py @@ -41,7 +41,7 @@ def __init__(self, routing_number: str): def __get_pydantic_core_schema__( cls, source: Type[Any], handler: GetCoreSchemaHandler ) -> core_schema.AfterValidatorFunctionSchema: - return core_schema.general_after_validator_function( + return core_schema.with_info_after_validator_function( cls._validate, core_schema.str_schema( min_length=cls.min_length,