title: How nestjs uses @nestjs/swagger to generate documentation on Passport strategies route
body: <p>I am making <a href="https://docs.nestjs.com/recipes/swagger" rel="nofollow noreferrer">@nestjs/swagger</a> to generate api documentation. But how do I generate a document for an authenticated route?</p>
  
  <p>nest version</p>
  
  <pre><code>λ nest i
  NodeJS Version : v10.16.0
  [Nest Information]
  platform-express version : 6.0.0
  passport version         : 6.1.0
  swagger version          : 3.1.0
  common version           : 6.0.0
  core version             : 6.0.0
  jwt version              : 6.1.1
  </code></pre>
  
  <p>This is a normal route, I can use '@ApiImplicitBody' to make a document:</p>
  
  <pre><code>  @Delete()
    @ApiImplicitBody({
      name: 'id',
      required: true,
      type: String,
    })
    @ApiOkResponse({
      description: 'successfully deleted',
    })
    delete(@Body('id') typeId) {
      return this.typesService.delete(typeId);
    }
  </code></pre>
  
  <p>This route requires <a href="https://docs.nestjs.com/techniques/authentication" rel="nofollow noreferrer">authentication</a>, how can I document this type of route?</p>
  
  <pre><code>  @UseGuards(AuthGuard('local'))
    @Post('login')
    @ApiOkResponse({
      description: 'result Token',
    })
    async login(@Request() req) {
      return this.authService.login(req.user);
    }
  </code></pre>
  
  <p>I looked at the <a href="https://docs.nestjs.com/recipes/swagger" rel="nofollow noreferrer">Swagger documentation</a> and tried some of the apis in the '@nestjs/swagger' package, but it didn't work.</p>