Skip to content

Commit f62336b

Browse files
committed
add steps for CLI migration
1 parent 2b7e1aa commit f62336b

File tree

1 file changed

+41
-1
lines changed

1 file changed

+41
-1
lines changed

api-playground/migrating-from-mdx.mdx

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,47 @@ If you are currently using individual `MDX` pages for your API endpoints, you ca
99

1010
You can define metadata and content for each endpoint in your OpenAPI specification and organize endpoints where you want them in your navigation.
1111

12-
## Migration steps
12+
## CLI migration
13+
14+
The `mint migrate-mdx` command is the recommended way to migrate from MDX endpoint pages to autogenerated pages.
15+
16+
This command:
17+
- Parses your `docs.json` navigation structure.
18+
- Identifies MDX pages that reference OpenAPI endpoints.
19+
- Extracts content from MDX files and moves it to the `x-mint` extension in your OpenAPI specification.
20+
- Migrates any existing `x-mcp` data into `x-mint`.
21+
- Updates your `docs.json` to reference the OpenAPI endpoints directly instead of MDX files.
22+
- Deletes the original MDX endpoint files.
23+
24+
<Info>
25+
If you already have `x-mint` defined for an endpoint and also have an MDX page with content for that endpoint, the MDX content will overwrite existing `x-mint` settings.
26+
27+
If you have multiple MDX pages for the same endpoint with different content, the script will use the content from the page that appears last in your `docs.json`.
28+
29+
The migration tool does not support previewing changes before applying them.
30+
</Info>
31+
32+
<Steps>
33+
<Step title="Prepare your OpenAPI specification.">
34+
Ensure your OpenAPI specification is valid and includes all endpoints you want to document.
35+
36+
Any MDX pages you want to migrate must have the `openapi:` frontmatter referencing an endpoint.
37+
38+
<Tip>
39+
Validate your OpenAPI file using the [Swagger Editor](https://editor.swagger.io/) or [Mint CLI](https://www.npmjs.com/package/mint).
40+
</Tip>
41+
</Step>
42+
<Step title="Install the Mint CLI">
43+
If needed, install or update the [Mint CLI](/installation).
44+
</Step>
45+
<Step title="Run the migration command.">
46+
```bash
47+
mint migrate-mdx
48+
```
49+
</Step>
50+
</Steps>
51+
52+
## Manual migration steps
1353

1454
<Steps>
1555
<Step title="Prepare your OpenAPI specification.">

0 commit comments

Comments
 (0)