Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/socketsomeone/nestjs-swagger-koa
📦 NestJS module for generating Swagger documentation for Koa applications
https://github.com/socketsomeone/nestjs-swagger-koa
adapter koa nestjs swagger
Last synced: 3 months ago
JSON representation
📦 NestJS module for generating Swagger documentation for Koa applications
- Host: GitHub
- URL: https://github.com/socketsomeone/nestjs-swagger-koa
- Owner: SocketSomeone
- License: mit
- Created: 2024-07-05T09:46:23.000Z (7 months ago)
- Default Branch: master
- Last Pushed: 2024-11-04T22:14:43.000Z (3 months ago)
- Last Synced: 2024-11-04T23:20:25.840Z (3 months ago)
- Topics: adapter, koa, nestjs, swagger
- Language: TypeScript
- Homepage: https://npmjs.com/package/nestjs-swagger-koa
- Size: 306 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
A module for generating Swagger documentation for Koa applications in NestJS.## About
This library is a NestJS module for generating Swagger documentation for Koa applications. Was created due this [issue](
https://github.com/nestjs/swagger/pull/2351) in the official NestJS Swagger module. Also, this library is based on the official NestJS
Swagger module and NestJS Koa adapter.## Installation
```bash
$ npm install --save nestjs-swagger-koa @nestjs/swagger nest-koa-adapter
$ yarn add nestjs-swagger-koa @nestjs/swagger nest-koa-adapter
$ pnpm add nestjs-swagger-koa @nestjs/swagger nest-koa-adapter
```## Usage
Usage was not changed from the official NestJS Swagger module. You can find the usage in the official
documentation [here](https://docs.nestjs.com/openapi/introduction).
All you need to do is to replace the `@nestjs/swagger` module with `nestjs-swagger-koa` and import the `NestKoaAdapter`
from `nest-koa-adapter`. Here is an example:```typescript
import { NestFactory } from '@nestjs/core';
import { DocumentBuilder } from '@nestjs/swagger';
import { AppModule } from './app.module';
import { KoaSwaggerModule } from 'nestjs-swagger-koa';async function bootstrap() {
const app = await NestFactory.create(AppModule);const config = new DocumentBuilder()
.setTitle('Cats example')
.setDescription('The cats API description')
.setVersion('1.0')
.addTag('cats')
.build();
const document = KoaSwaggerModule.createDocument(app, config);
KoaSwaggerModule.setup('api', app, document);await app.listen(3000);
}bootstrap();
```## Stay in touch
* Author - [Alexey Filippov](https://t.me/socketsomeone)
* Twitter - [@SocketSomeone](https://twitter.com/SocketSomeone)## License
[MIT](https://github.com/SocketSomeone/nestjs-swagger-koa/blob/master/LICENSE) © [Alexey Filippov](https://github.com/SocketSomeone)