From 9b57b1f7095ca900e820bd7d2e6cb1ea3b47e4d3 Mon Sep 17 00:00:00 2001 From: Nitzan Date: Sun, 28 Sep 2025 19:20:09 +0300 Subject: [PATCH] Set @classmethod in phone_numbers.py schema getter --- pydantic_extra_types/phone_numbers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pydantic_extra_types/phone_numbers.py b/pydantic_extra_types/phone_numbers.py index e86f8dd..3bdd78d 100644 --- a/pydantic_extra_types/phone_numbers.py +++ b/pydantic_extra_types/phone_numbers.py @@ -172,8 +172,9 @@ def __get_pydantic_core_schema__(self, source: type[Any], handler: GetCoreSchema core_schema.str_schema(), ) + @classmethod def __get_pydantic_json_schema__( - self, schema: core_schema.CoreSchema, handler: GetJsonSchemaHandler + cls, schema: core_schema.CoreSchema, handler: GetJsonSchemaHandler ) -> dict[str, Any]: json_schema = handler(schema) json_schema.update({'format': 'phone'})