Skip to content

DECLARATIVE-YAML-04: Make fields optional, defaulted, or nullable

The three field wrappers — optional, default, nullable — applied over a base schema.

Builds on: DECLARATIVE-YAML-03: Bound and shape strings with min/max, pattern, format

The declarative YAML artifact, verbatim — no code required.

frontmatter:
fields:
last_reviewed: { type: string, format: date, optional: true }
priority: { type: number, default: 3 }
archived_at: { type: string, format: date, nullable: true }
  • compileSchema() wrappers: .optional()
  • .default(value)
  • .nullable()