@korix/openapi-swagger-ui-plugin
v0.4.0
Published
Swagger UI plugin for OpenAPI documentation in Kori framework
Readme
@korix/openapi-swagger-ui-plugin
Swagger UI plugin for OpenAPI documentation in Kori framework.
Installation
npm install @korix/openapi-swagger-ui-pluginUsage
import { createKori } from '@korix/kori';
import { stdSchemaOpenApiPlugin } from '@korix/std-schema-openapi-plugin';
import { swaggerUiPlugin } from '@korix/openapi-swagger-ui-plugin';
const app = createKori()
.applyPlugin(
stdSchemaOpenApiPlugin({
info: {
title: 'My API',
version: '1.0.0',
},
}),
)
.applyPlugin(
swaggerUiPlugin({
path: '/docs',
title: 'My API Documentation',
}),
);Options
path
- Type:
string - Default:
'/docs'
The path where the Swagger UI will be served.
title
- Type:
string - Default:
'API Documentation'
The title of the API documentation page.
Features
- 📚 Interactive API documentation with Swagger UI
- 🚀 Zero configuration required
- 🎨 Clean and familiar Swagger UI interface
- 📦 Assets bundled and served automatically
- 🔄 Cache-friendly asset delivery with content hashing
- 🌐 Works seamlessly with OpenAPI plugin
Requirements
This plugin requires the @korix/openapi-plugin to be registered first. It will automatically use the OpenAPI specification generated by the OpenAPI plugin.
License
MIT
