Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

mw validate

Last updated: 2025-10-22

Synopsis: Check schemas, records, and references, emitting formatted errors when something is wrong.

Usage

mw [global flags] validate [--phase format|schema|references]... [--fail-fast]
FlagDescription
--phaseOptional. Repeat to run a subset of phases. By default all phases run (format, schema, then references).
--fail-fastStop after the first error. Defaults to the global --fail-fast flag.

When you request the references phase, Mergeway automatically includes the schema phase so reference checks have the information they need.

Examples

Run the command from the workspace root (or add --root to point elsewhere).

Validate the current workspace:

mw validate

Add --format json when you need machine-readable output.

Output:

validation succeeded

Run validation after introducing a breaking schema change:

mw validate

Output when the Post schema requires an author but the record is missing it:

- phase: schema
  type: Post
  id: post-001
  file: data/posts/launch.yaml
  message: missing required field "author"

The command writes errors to standard output and still exits with status 0, so automation should check whether any errors were returned.

  • mw config lint — validate configuration without loading data.
  • mw list — locate the objects mentioned in validation errors.


Generated at 2025-10-30 22:44:13 (commit: 3a1f254)