Skip to content

DECLARATIVE-YAML-02: Constrain with enum and const

Pinning a field to a fixed literal (const) or a closed set of allowed values (enum).

Builds on: DECLARATIVE-YAML-01: Validate one required frontmatter field by type

The declarative YAML artifact, verbatim — no code required.

frontmatter:
fields:
type:
const: decision
status:
enum: [open/ready, in-progress/active, closed/done]
  • schema.ts base(): const -> z.literal()
  • enum -> z.enum()