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 config export

Last updated: 2025-10-22

Synopsis: Emit a JSON Schema for one of your types.

Usage

mw [global flags] config export --type <type>
FlagDescription
--typeRequired. Type identifier to export.

Example

Run the command from the workspace root (or pass --root). Export the Post type as JSON Schema:

mw --root examples --format json config export --type Post

Output (abridged):

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "properties": {
    "author": {
      "type": "string",
      "x-reference-type": "User"
    },
    "title": {
      "type": "string"
    }
  },
  "required": ["id", "title", "author"],
  "type": "object"
}

Fields that reference other types include the x-reference-type hint.

Validate your workspace (mw config lint or mw validate) after editing type files to ensure the exported schema stays in sync.

  • mw entity show — view the full Mergeway representation of an entity.
  • mw validate — ensure data conforms to the schema you just exported.


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