Overview
The OpenAPI plugin for Docusaurus v3, docusaurus-plugin-openapi-docs, extends the Docusaurus CLI to generate MDX API reference docs using the OpenAPI specification. The resulting MDX files are compatible with the docusaurus-theme-openapi-docs theme, allowing for the creation of visually appealing API documentation. It is fast, stylish, and supports various types of OpenAPI specifications.
Features
- Compatible: Works with Swagger 2.0 and OpenAPI 3.x.
- Fast: Converts large OpenAPI specs into MDX docs in seconds.
- Stylish: Based on the Infima styling framework used by Docusaurus UI.
- Flexible: Supports single, multi, and micro OpenAPI specs.
Installation
To install the docusaurus-plugin-openapi-docs and docusaurus-theme-openapi-docs for an existing Docusaurus site, follow these steps:
- Install the plugins using npm:
npm install docusaurus-plugin-openapi-docs docusaurus-theme-openapi-docs
- Configure the docusaurus.config.ts file with the necessary settings for plugin and theme usage as per your requirements.
Summary
The OpenAPI plugin for Docusaurus v3 provides a seamless way to generate API reference documentation from OpenAPI specs. With its compatibility with various OpenAPI versions, speed in converting large specs to MDX, stylish design based on Infima, and flexibility in supporting different types of specs, this plugin is a valuable tool for creating comprehensive API documentation. Installation and configuration are straightforward, making it easy to integrate with existing Docusaurus sites.