OpenAPI Setup
Reference OpenAPI endpoints in your docs pages
Getting Started with OpenAPI Integration
Prerequisites
Before integrating OpenAPI into your documentation, ensure you have:
- A valid OpenAPI document (JSON or YAML format)
- OpenAPI specification 3.0 or higher
- Mintlify CLI installed
Validate your OpenAPI specification using our CLI:
Implementation Methods
Method 1: Auto-population with Navigation Tabs
The quickest way to implement OpenAPI is through your docs.json
configuration. You can either reference a local file or a hosted URL.
Auto-generated pages will use the following metadata by default:
- Title: OpenAPI operation summary or generated from HTTP method/endpoint
- Description: OpenAPI operation description
- Version: Version value from the anchor/tab (if present)
Method 2: Custom MDX Pages
For more control over your API documentation, you can create individual MDX pages for each operation.
Create an MDX File
Create a new MDX file for your API endpoint. Here’s an example structure:
Specify OpenAPI Reference
The openapi
field format should follow:
If you only have one OpenAPI file, the file path is optional - Mintlify will automatically detect it.
Add Custom Content
Add any additional content or customization below the frontmatter.
The method and path must exactly match those in your OpenAPI document. For webhooks, use “webhook” instead of the HTTP method (e.g., “POST”).
Method 3: Automated File Generation
For large OpenAPI documents, use our scraping tool to automatically generate MDX files.
Install the Scraper
Use our @mintlify/scraping package:
Specify Output Directory
Add the -o
flag to choose where files are generated:
Update Navigation
Add the generated navigation entries to your configuration:
- Append them to existing navigation, or
- Manually organize them in your preferred structure
The scraper requires a valid OpenAPI document. Invalid specifications will not generate files.
Working with OpenAPI Schemas
Individual Schema Pages
Create dedicated pages for schemas defined in your OpenAPI document’s components.schemas
:
Schema pages automatically inherit documentation from your OpenAPI specification while allowing you to add custom content and examples.
Was this page helpful?