We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Swagger decorator @ApiHeader is not including header on request
@Controller('template') export class TemplateController { @Get('test') @ApiHeader({ name: 'accept', }) async test(@Headers('accept') acceptHeader: string) { return `ok: ${acceptHeader}`; } }
https://codesandbox.io/p/devbox/green-cache-5xjgvc
Just create a new NestJS project and add a new Controller like TemplateController above.
TemplateController
Expect that Swagger UI to include the proper accept value on request.
accept
@nestjs/common
@nestjs/core
@nestjs/microservices
@nestjs/platform-express
@nestjs/platform-fastify
@nestjs/platform-socket.io
@nestjs/platform-ws
@nestjs/testing
@nestjs/websockets
@nestjs/swagger
10.3.3
"@nestjs/common": "10.3.3", "@nestjs/config": "3.2.0", "@nestjs/core": "10.3.3", "@nestjs/platform-express": "10.3.3", "@nestjs/swagger": "7.3.0", "class-transformer": "0.5.1", "class-validator": "0.14.1",
18.12.0
No response
The text was updated successfully, but these errors were encountered:
this problem is specifically related to the 'accept' header. It works fine with other headers, but it doesn't with the accept header
Sorry, something went wrong.
Confirmed in the provided example: https://codesandbox.io/p/devbox/green-cache-5xjgvc
No branches or pull requests
Is there an existing issue for this?
Current behavior
Swagger decorator @ApiHeader is not including header on request
Code
Result
Minimum reproduction code
https://codesandbox.io/p/devbox/green-cache-5xjgvc
Steps to reproduce
Just create a new NestJS project and add a new Controller like
TemplateController
above.Expected behavior
Expect that Swagger UI to include the proper
accept
value on request.Package
@nestjs/common
@nestjs/core
@nestjs/microservices
@nestjs/platform-express
@nestjs/platform-fastify
@nestjs/platform-socket.io
@nestjs/platform-ws
@nestjs/testing
@nestjs/websockets
Other package
@nestjs/swagger
NestJS version
10.3.3
Packages versions
Node.js version
18.12.0
In which operating systems have you tested?
Other
No response
The text was updated successfully, but these errors were encountered: