Update from individual MDX endpoint pages to automated OpenAPI generation with flexible navigation
MDX
pages for your API endpoints, you can migrate to autogenerating pages from your OpenAPI specification while retaining the customizability of individual pages. This can help you reduce the number of files you need to maintain and improve the consistency of your API documentation.
You can define metadata and content for each endpoint in your OpenAPI specification and organize endpoints where you want them in your navigation.
mint migrate-mdx
command is the recommended way to migrate from MDX endpoint pages to autogenerated pages.
This command:
docs.json
navigation structure.x-mint
extension in your OpenAPI specification.x-mcp
data into x-mint
.docs.json
to reference the OpenAPI endpoints directly instead of MDX files.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.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
.The migration tool does not support previewing changes before applying them.Prepare your OpenAPI specification.
openapi:
frontmatter referencing an endpoint.Install the Mint CLI
Run the migration command.
Prepare your OpenAPI specification.
x-mint
extension to the endpoint. See x-mint extension for more details.For any endpoints that you want to exclude from your documentation, add the x-hidden
extension to the endpoint.Update your navigation structure.
MDX
page references with OpenAPI endpoints in your docs.json
.Remove old MDX files.
MDX
endpoint files that you no longer need.MDX
pagesMDX
pages when you need: