mergeway-cli config export
Emit a JSON Schema for one of your types.
Synopsis: Emit a JSON Schema for one of your types.
Usage
mergeway-cli [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:
mergeway-cli --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 (mergeway-cli config lint or mergeway-cli validate) after editing type files to ensure the exported schema stays in sync.
Related Commands
mergeway-cli entity show— view the full Mergeway representation of an entity.mergeway-cli validate— ensure data conforms to the schema you just exported.