Is there an existing issue for this?
Current behavior
It appears that the Swagger CLI is adding an extra 200 response code to a method that will never return a 200 response. Specifically, for a method that always returns a dynamic redirect that's been labeled with @ApiFoundResponse
Example:
interface RedirectResponse {
url: string
statusCode?: number
}
@Get()
@ApiFoundResponse({ description: 'Redirects to a URL' })
@Redirect()
getRedirect(): RedirectResponse {
return {
url: `https://example.com`,
statusCode: HttpStatus.FOUND,
}
}
Which produces:
"/example": {
"get": {
...
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
},
"302": {
"description": "Redirects to a URL"
}
}
}
Minimum reproduction code
See above.
Steps to reproduce
See above.
Expected behavior
Only a single response is rendered - no 200 for a redirect.
Package version
5.1.3
NestJS version
8.0.11
Node.js version
14
In which operating systems have you tested?
Other
No response
Is there an existing issue for this?
Current behavior
It appears that the Swagger CLI is adding an extra 200 response code to a method that will never return a 200 response. Specifically, for a method that always returns a dynamic redirect that's been labeled with
@ApiFoundResponseExample:
Which produces:
Minimum reproduction code
See above.
Steps to reproduce
See above.
Expected behavior
Only a single response is rendered - no 200 for a redirect.
Package version
5.1.3
NestJS version
8.0.11
Node.js version
14
In which operating systems have you tested?
Other
No response