-
Notifications
You must be signed in to change notification settings - Fork 513
Closed
Labels
Description
I'm submitting a Potential bug
[ ] Regression
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
Current behavior
I use nestjs/swagger
with swagger-ui-express
.
I set the decorator @ApiProduces("text/csv")
but nothing is displayed in Swagger-ui.
I check the produced specs using F12 on Swagger-UI and nothing, in the specs, involved "Produces".
Expected behavior
The user can choose the Content-Type of the Response in Swagger-UI. As shown on the image below. This image is generated with YAML.
The GET
attribute has :
produces:
- application/json
- text/csv
Minimal reproduction of the problem with instructions
Insert this function in a controller.
@Get('thing')
@ApiProduces("text/csv")
// @ApiProduces("text/csv", "application/json")
public test(): any {
return {
id: "id",
name: "name"
};
}
Environment
Last version.
"@nestjs/common": "^6.7.2",
"@nestjs/config": "0.0.9",
"@nestjs/core": "^6.7.2",
"@nestjs/platform-express": "^6.7.2",
"@nestjs/swagger": "^4.4.0",
"swagger-ui-express": "^4.1.4"
For Tooling issues:
- Platform: Windows