Reputation: 562
I want to group API endpoints based on tags in Nest.js such that all employee endpoints under Employee tag, all site endpoints under Site tag etc. Currently, all my endpoints are under default tag. I am using Swagger in Nest.js.
How can I implement it?
Upvotes: 10
Views: 11289
Reputation: 21147
To attach a controller to a specific tag, use the @ApiTags(...tags)
decorator.
@ApiTags('cats')
@Controller('cats')
export class CatsController {}
Upvotes: 35