DECLARATIVE-YAML-04: Make fields optional, defaulted, or nullable
What it demonstrates
Section titled “What it demonstrates”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
How it’s done
Section titled “How it’s done”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 }Surfaces exercised
Section titled “Surfaces exercised”compileSchema() wrappers: .optional().default(value).nullable()