You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: api-playground/migrating-from-mdx.mdx
+41-1Lines changed: 41 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,47 @@ If you are currently using individual `MDX` pages for your API endpoints, you ca
9
9
10
10
You can define metadata and content for each endpoint in your OpenAPI specification and organize endpoints where you want them in your navigation.
11
11
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
+
<Steptitle="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
+
<Steptitle="Install the Mint CLI">
43
+
If needed, install or update the [Mint CLI](/installation).
0 commit comments