title: In NestJS, what is the decorator I can add at a controller level to add an Authorization header to my Swagger docs?
body: <p>I'm using NestJS 7.6.11.  I have the following decorators on my controller ...</p>
  <pre><code>@Controller('private')
  @ApiTags('MyObjects')
  @ApiConsumes('application/json')
  @ApiProduces('application/json')
  @UseInterceptors(new JwtInterceptor())
  export class MyController {
  </code></pre>
  <p>Is there any decorator I can add that would result in Swagger (OpenAPI 3) documentation being generated such that it indicates that all methods in my controller need to have an &quot;authorization&quot; header?</p>
  <p><b>Edit:</b> In response the answer given I added the @ApiHeader so my controller and method look like</p>
  <p>@</p>
  <pre><code>Controller('myendpoint')
  @ApiTags('MyObject')
  @ApiConsumes('application/json')
  @ApiProduces('application/json')
  @ApiHeader({
    name: 'authorization',
    description: 'Auth token',
  })
  @UseInterceptors(new JwtInterceptor())
  export class MyObjectController {
  
  ...
   @Get('/:id')
    @ApiOkResponse({
      description: 'OK',
      type: Content,
    })
    @ApiBadRequestResponse()
    @ApiInternalServerErrorResponse()
    @ApiOperation({
      summary: 'Get object by id',
      description: 'Get object by id',
      operationId: 'findObjectById',
    }) 
    findObjectById(@Req() req, @Param('id') id: string): Promise&lt;MyObject&gt; {
  </code></pre>
  <p>but when the swagger docs are generated, although I'm able to enter an &quot;authorization&quot; header value,</p>
  <p><a href="https://i.stack.imgur.com/GNz88.png" rel="noreferrer"><img src="https://i.stack.imgur.com/GNz88.png" alt="enter image description here" /></a></p>
  <p>it doesn't get included with my curl when I click &quot;Execute&quot;, which is generated as</p>
  <pre><code>curl -X GET &quot;http://localhost:8060/myendpoint/abcdef&quot; -H  &quot;accept: application/json&quot;
  </code></pre>