Skip to content

Commit 47aa78e

Browse files
🐛 set @classmethod in phone_numbers schema (#339)
1 parent ecf1e33 commit 47aa78e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pydantic_extra_types/phone_numbers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,9 @@ def __get_pydantic_core_schema__(self, source: type[Any], handler: GetCoreSchema
172172
core_schema.str_schema(),
173173
)
174174

175+
@classmethod
175176
def __get_pydantic_json_schema__(
176-
self, schema: core_schema.CoreSchema, handler: GetJsonSchemaHandler
177+
cls, schema: core_schema.CoreSchema, handler: GetJsonSchemaHandler
177178
) -> dict[str, Any]:
178179
json_schema = handler(schema)
179180
json_schema.update({'format': 'phone'})

0 commit comments

Comments
 (0)