You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please add an additional validation for phone numbers. This is a pretty common need especially with SMS 2FA, I think this is useful to setup so we can have a @phone
E.164 phone number (used for Phone/SMS etc)
/**
* Validates a string field value is a valid E.164 phone number format (+[country code][number])
*/
attribute @phone(_ message: String?) @@@targetField([StringField]) @@@validation @@@supportTypeDef
I'm currently using it with a regex, but I think it's worth having it built-in:
/// The phone number in E.164 format (e.g., +16175551212)
phone String? @regex('^\\+[1-9]\\d{1,14}$', message: "Phone number must be in E.164 format (e.g., +16175551212)")
The text was updated successfully, but these errors were encountered:
No this is not a duplicate. That is related and links to zod E.164 phone number validation. Which actually seems to have been already added in Zod: colinhacks/zod#3476 as a merged PR back in May.
This issue is for adding @phone (or similar) in zenstack to use this functionality.
Please add an additional validation for phone numbers. This is a pretty common need especially with SMS 2FA, I think this is useful to setup so we can have a @phone
E.164 phone number (used for Phone/SMS etc)
I'm currently using it with a regex, but I think it's worth having it built-in:
The text was updated successfully, but these errors were encountered: