DECLARATIVE-YAML-03: Bound and shape strings with min/max, pattern, format
What it demonstrates
Section titled “What it demonstrates”Adding numeric bounds, a regex pattern, and a named string format to a typed field.
Builds on: DECLARATIVE-YAML-02: Constrain with enum and const
How it’s done
Section titled “How it’s done”The declarative YAML artifact, verbatim — no code required.
frontmatter: fields: id: { type: string, pattern: '^D-\d{4}$' } title: { type: string, min: 1, max: 80 } created: { type: string, format: date } contact: { type: string, format: email } weight: { type: number, int: true, min: 0, max: 5 }Surfaces exercised
Section titled “Surfaces exercised”schema.ts typed(): .min/.max.regex(pattern)STRING_FORMATS (date/email -> z.iso.date()/z.email())int -> z.int()