From a425d240db83d3feb0cb63ac1b3dfc02e96b5660 Mon Sep 17 00:00:00 2001 From: sanny-io Date: Tue, 26 May 2026 00:31:09 -0700 Subject: [PATCH] docs: `@phone` and `isPhone` --- docs/reference/zmodel/input-validation.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/reference/zmodel/input-validation.md b/docs/reference/zmodel/input-validation.md index 2eb52c3d..fe859dd0 100644 --- a/docs/reference/zmodel/input-validation.md +++ b/docs/reference/zmodel/input-validation.md @@ -63,6 +63,14 @@ All field-level attributes have a `message` parameter that allows you to provide Requires a string field to be a valid email address. + - `@phone` + + ```zmodel + @phone(_ message: String?) + ``` + + Requires a string field to be a valid E.164 phone number. + - `@url` ```zmodel @@ -195,6 +203,14 @@ All field-level attributes have a `message` parameter that allows you to provide Checks if a string field is a valid email address. +- `isPhone()` + + ```zmodel + function isPhone(field: String): Boolean {} + ``` + + Checks if a string field is a valid E.164 phone number. + - `isUrl()` ```zmodel