0.4.2 • Published 1 year ago
@marxlnfcs/nest-swagger-decorators v0.4.2
Installation
npm i @marxlnfcs/nest-swagger-decorators
Usage
Controller
@ApiController('/', {
tags: [ ... ],
tagGroups: [ ... ],
header: { ... },
params: { ... },
query: { ... },
})
export class AppController {}
@ApiController({
path: '/',
tags: [ ... ],
tagGroups: [ ... ],
header: { ... },
params: { ... },
query: { ... },
})
export class AppController {}
// Controller will not be added to the documentation. Equals to @ApiExcludeController
@ApiController('/', false)
export class AppController {}
Routes
@ApiController('/')
export class AppController {
@ApiGet('/', { ... })
@ApiGet({ path: '/', ... })
@ApiGet('/', false) // Endpoint will not be added to the documentation. Equals to @ApiExcludeEndpoint
ping(){ ... }
}
Exceptions
@ApiController('/')
export class AppController {
@ApiGet('/')
@ApiNotFoundException()
@ApiUnauthorizedException()
ping(){ ... }
}
TagGroups
@ApiController('/')
@TagGroups(...)
export class AppController {
@ApiGet('/', { ... })
@ApiTagGroups(...)
ping(){ ... }
}
Retrieve TagGroups
import {getApiTagGroups} from "@marxlnfcs/nest-swagger-decorators";
const tagGroups = getApiTagGroups();
/**
* RETURNS:
* [
* {
* name: string,
* tags: string[]
* },
* ...
* ]
*/
0.4.2
1 year ago
0.4.1
1 year ago
0.4.0
1 year ago
0.3.0
1 year ago
0.3.1
1 year ago
0.1.0
2 years ago
0.2.1
2 years ago
0.1.2
2 years ago
0.2.0
2 years ago
0.1.1
2 years ago
0.0.8
2 years ago
0.2.3
2 years ago
0.1.4
2 years ago
0.0.5
2 years ago
0.2.2
2 years ago
0.1.3
2 years ago
0.0.4
2 years ago
0.1.6
2 years ago
0.0.7
2 years ago
0.1.5
2 years ago
0.0.6
2 years ago
0.0.3
2 years ago
0.0.2
2 years ago
0.0.1
2 years ago