"type": "string" for free-form text fields. Then add constraints to control size, format, and allowed values.
Supported keywords
| Keyword | What it does |
|---|---|
type: "string" | Declares a text field |
minLength / maxLength | Bounds text length |
pattern | Enforces a regex |
format | Semantic format check (email, uri) |
Length constraints
Pattern constraints
Format constraints
| Format | Description | Example of Accepted Value |
|---|---|---|
date-time | RFC 3339 date-time | "2026-03-23T14:30:00Z" |
date | RFC 3339 date | "2026-03-23" |
date-time-local | Date-time without timezone | "2026-03-23T14:30:00" |
time | RFC 3339 time with timezone | "14:30:00Z" |
time-local | Time without timezone | "14:30:00" |
duration | ISO 8601 duration | "P3Y6M4DT12H30M5S" |
unixtime | Seconds since Unix epoch | "1742739000" |
utc-millisec | Milliseconds since Unix epoch | "1742739000000" |
email | RFC 5321 email address | "alice@example.com" |
uuid | RFC 9562 UUID | "550e8400-e29b-41d4-a716-446655440000" |
uri | RFC 3986 URI | "https://example.com/path" |
uri-reference | URI or relative reference | "/path/to/resource" |
uri-template | RFC 6570 URI template | "https://example.com/{id}" |
url | Full URL with scheme | "https://example.com" |
hostname | RFC 1123 hostname | "example.com" |
ipv4 | IPv4 address | "192.168.1.1" |
ipv6 | IPv6 address | "::1" |
byte | Base64-encoded string | "SGVsbG8=" |
double | Double-precision float as string | "3.141592653589793" |
double-int | Integer stored as double | "42" |
float | Single-precision float as string | "3.14" |
int8 | Integer in [-128, 127] | "42" |
int16 | Integer in [-32768, 32767] | "1000" |
int32 | Integer in [-2³¹, 2³¹-1] | "100000" |
int64 | Integer in [-2⁶³, 2⁶³-1] | "9999999999" |
uint8 | Integer in [0, 255] | "200" |
uint16 | Integer in [0, 65535] | "50000" |
uint32 | Integer in [0, 2³²-1] | "3000000000" |
uint64 | Integer in [0, 2⁶⁴-1] | "10000000000" |
decimal | Arbitrary-precision decimal | "99.95" |
decimal128 | IEEE 754 decimal128 | "12345.6789012345" |
sf-binary | RFC 8941 structured field binary | ":SGVsbG8=:" |
sf-boolean | RFC 8941 structured field boolean | "?1" |
sf-decimal | RFC 8941 structured field decimal | "3.14" |
sf-integer | RFC 8941 structured field integer | "42" |
sf-string | RFC 8941 structured field string | "\"hello\"" |
sf-token | RFC 8941 structured field token | "abc" |
expose | Any string (no validation) | "anything" |