@forinda/kickjs-swagger
v5.3.0
Published
OpenAPI spec generation from decorators, Swagger UI and ReDoc serving for KickJS
Maintainers
Keywords
Readme
@forinda/kickjs-swagger
Auto-generated OpenAPI spec from decorators + Zod schemas. Serves Swagger UI at /docs, ReDoc at /redoc, raw JSON at /openapi.json.
Install
kick add swaggerQuick Example
import { bootstrap } from '@forinda/kickjs'
import { SwaggerAdapter } from '@forinda/kickjs-swagger'
import { modules } from './modules'
export const app = await bootstrap({
modules,
adapters: [
SwaggerAdapter({
info: { title: 'My API', version: '1.0.0' },
bearerAuth: true,
disableInProd: true,
}),
],
})Decorators (@ApiTags, @ApiOperation, @ApiResponse, @ApiBearerAuth, @ApiExclude) refine the generated spec. For non-Zod schemas, plug a custom SchemaParser (Joi, Yup, Valibot, etc.).
Documentation
forinda.github.io/kick-js/guide/swagger
License
MIT
