Put in order · NestJS course · Module 11: Swagger and OpenAPI

Hierarchy of Decorators on an Endpoint

Order the Swagger decorators on an endpoint from the class decorator to the method body:

Items to put in order

  • Method body (return ...)
  • @ApiTags('Name') on the controller class
  • @ApiResponse({ status }) above the method
  • @ApiOperation({ summary }) above the method

You can check the correct answer by solving this task in the CodeWorlds game.