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>
| Flag | Description |
|---|---|
--type | Required. 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.
Related Commands
mw entity show— view the full Mergeway representation of an entity.mw validate— ensure data conforms to the schema you just exported.