NestJS · Middle · Question 10 of 75
How do you combine several decorators into one, e.g. guards plus Swagger annotations?
- 1Decorators can't be combined
- ✓Correct answer: With
applyDecorators(UseGuards(AuthGuard), ApiBearerAuth(), ...) - 3By nesting them in a class
Explanation
A single @Auth('admin') decorator can set roles metadata, apply guards and document the route.