Tim Woohoo
Tim Woohoo

Reputation: 562

How to group endpoints in Nest js with Swagger

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

Answers (1)

Jesse Carter
Jesse Carter

Reputation: 21147

To attach a controller to a specific tag, use the @ApiTags(...tags) decorator.

@ApiTags('cats')
@Controller('cats')
export class CatsController {}

docs

Upvotes: 35

Related Questions