Showcasing APIs with Starlight OpenAPI
For REST APIs, an OpenAPI (Swagger) specification is the gold standard. starlight-openapi allows you to render these specifications directly within your Starlight documentation site.
Features
Section titled “Features”- Schema Rendering: Beautifully formatted API endpoints and models.
- Sidebar Integration: Adds API categories to your navigation.
- Multiple Schemas: Support for documenting multiple APIs.
How to use
Section titled “How to use”- Have your
openapi.jsonoropenapi.yamlready. - Install the plugin:
npm install starlight-openapi- Configure it:
import starlightOpenAPI from 'starlight-openapi';
// ...plugins: [ starlightOpenAPI([ { base: 'api', label: 'My API', schema: './src/openapi.yaml', }, ]),],Your API documentation will now be accessible under /api!