I want to add desription for block of api.
I have tried:
@ApiOperation({
description: 'Operation description'
})
It doesn't work.
Adding description on method level
@ApiOperation({ summary: 'Operation description' })
Check here: https://docs.nestjs.com/openapi/migration-guide#breaking-changes
Adding tag on class level (controller)
@ApiTags('MyTag')
This will create a collapsible block with all methods underneath it.
Check here: https://docs.nestjs.com/openapi/decorators
To improve previous answer: You can add tag description on initial step
new DocumentBuilder()
.setTitle('API with NestJS')
...
.addTag('SomeTag1', 'Tag description 1')
.addTag('SomeTag2', 'Tag description 2')
And then use tag on class level (controller)
@ApiTags('SomeTag1')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With