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
docs(data-modeling): stop crediting field format with validation
The write-time record validator keys its email/url/phone shape checks on
the field `type` and never reads a field's `format`. Six hand-written rows
(plus the quick-summary `text` row) said otherwise, and three declared a
`format` default that does not exist.
- `text` rows now say what the key is: a display hint read by the UI's
cell-renderer resolver for a small word set, with no server-side check.
- The `phone` gallery row promised a pattern nothing implements; removed.
- `email` / `url` / `phone` validation tables list the bounds the
validator does enforce and say the shape check keys on `type`.
Claude-Session: https://claude.ai/code/session_01VDtqoecgES7ScQYGbFVDRv
Co-authored-by: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: content/docs/data-modeling/field-types.mdx
+1-2Lines changed: 1 addition & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ Single-line plain text input.
21
21
|:---|:---|:---|:---|
22
22
|`maxLength`|`number`| — | Maximum character length |
23
23
|`minLength`|`number`| — | Minimum character length |
24
-
|`format`|`string`| — |Validation format pattern|
24
+
|`format`|`string`| — |Display hint, **not validation** — the server runs no check from it. The UI's cell-renderer resolver reads a small set of words and renders the cell as the richer type: `phone` / `tel` / `telephone` (a `tel:` link), `email` (a `mailto:` link), `url` / `uri` / `link` (a clickable link), `currency` / `money`, `percent` / `percentage`; any other word renders as plain text. To reject a malformed email, URL or phone number, use that field `type` instead, or a [`format` validation rule](/docs/data-modeling/validation#format-validation)|
25
25
|`valueDomain`|`'iana_time_zone' \| 'iso_4217_currency' \| 'iso_3166_alpha2'`| — | Standard the written value must be a member of (IANA time zone, ISO 4217 currency code, ISO 3166-1 alpha-2 country code); `text` only |
26
26
27
27
```typescript
@@ -68,7 +68,6 @@ Phone number field.
68
68
| Property | Type | Default | Description |
69
69
|:---|:---|:---|:---|
70
70
|`maxLength`|`number`| — | Maximum character length |
Copy file name to clipboardExpand all lines: content/docs/data-modeling/validation-rules.mdx
+11-8Lines changed: 11 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,7 +43,7 @@ These properties apply to **all** field types and are validated by the base `Fie
43
43
|:---|:---|:---|:---|
44
44
|`maxLength`|`number`| — | Rejects values exceeding character count |
45
45
|`minLength`|`number`| — | Rejects values below character count |
46
-
|`format`|`string`| — |Validates against format pattern (e.g., regex) |
46
+
|`format`|`string`| — |**Not validated.** No write-time check reads it — a regex here is accepted and ignored. On `text` it is a display hint only (a small set of words such as `phone`, `email` or `url` promote the cell to a richer renderer; see the [Field Type Gallery](/docs/data-modeling/field-types)). To constrain the value's shape, use the `email` / `url` / `phone` field type or a [`format` validation rule](/docs/data-modeling/validation#format-validation)|
47
47
|`valueDomain`|`'iana_time_zone' \| 'iso_4217_currency' \| 'iso_3166_alpha2'`| — | Constrains the written value to a published standard — an IANA time zone (judged by the `Intl.DateTimeFormat` probe, so `UTC` and `Asia/Kolkata` are members and `Europe/Munich` is not), an ISO 4217 currency code or an ISO 3166-1 alpha-2 country code (both exact uppercase). Membership, not shape: a pattern such as `^[A-Z]{2}$` admits `ZZ`; the domain does not. The same closed vocabulary and the same membership test as a settings specifier's `valueDomain`; a non-member is refused on the write path with the field error code `value_domain`. `text` only — declaring it on any other type is refused at parse. |
48
48
49
49
**Default constraints:** None. Unbounded text unless `maxLength` is set.
@@ -61,25 +61,28 @@ These properties apply to **all** field types and are validated by the base `Fie
61
61
62
62
| Property | Type | Default | Validation Behavior |
63
63
|:---|:---|:---|:---|
64
-
|`format`|`string`|`email`| Validates a basic `local@domain` shape |
64
+
|`maxLength`|`number`| — | Rejects values exceeding character count |
65
+
|`minLength`|`number`| — | Rejects values below character count |
65
66
66
-
**Default constraints:** Must contain an `@` and a domain with a dot — a lightweight pattern check, not full RFC 5322 validation.
67
+
**Default constraints:** Must contain an `@` and a domain with a dot — a lightweight pattern check, not full RFC 5322 validation. The check is keyed on `type: 'email'` itself and has nothing to configure; a field-level `format` key is not read.
67
68
68
69
### `url`
69
70
70
71
| Property | Type | Default | Validation Behavior |
71
72
|:---|:---|:---|:---|
72
-
|`format`|`string`|`url`| Validates URL format (protocol required) |
73
+
|`maxLength`|`number`| — | Rejects values exceeding character count |
74
+
|`minLength`|`number`| — | Rejects values below character count |
73
75
74
-
**Default constraints:** Must be a valid URL with protocol prefix.
76
+
**Default constraints:** Must be a valid URL with protocol prefix. The check is keyed on `type: 'url'` itself and has nothing to configure; a field-level `format` key is not read.
75
77
76
78
### `phone`
77
79
78
80
| Property | Type | Default | Validation Behavior |
79
81
|:---|:---|:---|:---|
80
-
|`format`|`string`|`phone`| Validates a permissive phone-number character set |
82
+
|`maxLength`|`number`| — | Rejects values exceeding character count |
83
+
|`minLength`|`number`| — | Rejects values below character count |
81
84
82
-
**Default constraints:** Accepts digits, `+ ( ) - .` and spaces (minimum 5 characters) — a lenient character-set check, not strict E.164 structural validation.
85
+
**Default constraints:** Accepts digits, `+ ( ) - .` and spaces (minimum 5 characters) — a lenient character-set check, not strict E.164 structural validation. The check is keyed on `type: 'phone'` itself and has nothing to configure; a field-level `format` key is not read. For a stricter shape, add a [`format` validation rule](/docs/data-modeling/validation#format-validation) with a `regex`.
0 commit comments