Skip to content

Commit 6088a9a

Browse files
fix: validate phone numbers
1 parent 817b2a7 commit 6088a9a

File tree

1 file changed

+2
-1
lines changed
  • packages/models-library/src/models_library/rpc/notifications

1 file changed

+2
-1
lines changed

packages/models-library/src/models_library/rpc/notifications/schemas.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from typing import Annotated, Literal, TypeAlias
22

33
from pydantic import BaseModel, ConfigDict, EmailStr, Field
4+
from pydantic_extra_types.phone_numbers import PhoneNumber
45

56

67
class Event(BaseModel):
@@ -21,7 +22,7 @@ class EmailChannel(BaseModel):
2122
class SMSChannel(BaseModel):
2223
type: Literal["sms"] = "sms"
2324

24-
phone_number: str # Consider using phone number validation library here
25+
phone_number: PhoneNumber
2526

2627

2728
Channel: TypeAlias = EmailChannel | SMSChannel

0 commit comments

Comments
 (0)