You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
used the search to make sure that a similar issue hasn't already been submit
Expected Behavior
Using this kind of controller
interfaceResponseHeaders{/** * Pagination uses Link header as defined in RFC5988 */Link: string;}
@Route("/")exportclassFooControllerextendsController{
@Get()
@SuccessHeaders<ResponseHeaders>()publicasyncget(
@Res()failed: TsoaResponse<400,string,ResponseHeaders>): Promise<number>{if(false){failed(400,"failure",{Link: ""});}else{this.setHeader("Link",'<https://localhost:3000/?page=2>; rel="next"');return1;}}}
"paths": {"/": {"get": {"operationId": "Get","responses": {"200": {"description": "Ok","content": {"application/json": {"schema": {"type": "number","format": "double"}}},"headers": {"Link": {"description": "Pagination uses Link header as defined in RFC5988","schema": {"type": "string"}}}},"400": {"description": "","content": {"application/json": {"schema": {"type": "string"}}},"headers": {"Link": {"description": "Pagination uses Link header as defined in RFC5988","schema": {"type": "string"}}}}},"security": [],"parameters": []}}},
I presumed @SuccessHeaders is an upcoming feature from #723.
Also, in real life it doesn't make sense to include the link header in error response, but I included it here just to illustrate that TsoaResponse should have the same functionality.
Current Behavior
Currently the generated specification has only the content schemas:
Version of the library: 3.2.1
Version of NodeJS: 12.18.3
Confirm you were using yarn not npm: [x]
Detailed Description
Breaking change?
Probably not for @SuccessHeaders as is not in 3.x? For TsoaResponse probably not either, as this would only add the optional descriptions and spec generation as a new feature, but I don't know.
The text was updated successfully, but these errors were encountered:
Sorting
I'm submitting a ...
I confirm that I
Expected Behavior
Using this kind of controller
It would be nice if the generated OpenAPI specification would have specifications for the response headers as well (as per https://swagger.io/specification/#response-object):
I presumed
@SuccessHeaders
is an upcoming feature from #723.Also, in real life it doesn't make sense to include the link header in error response, but I included it here just to illustrate that
TsoaResponse
should have the same functionality.Current Behavior
Currently the generated specification has only the content schemas:
Possible Solution
Steps to Reproduce
Working example repository https://github.com/rhietala/tsoa-response-header
Context (Environment)
Version of the library: 3.2.1
Version of NodeJS: 12.18.3
Detailed Description
Breaking change?
Probably not for
@SuccessHeaders
as is not in 3.x? ForTsoaResponse
probably not either, as this would only add the optional descriptions and spec generation as a new feature, but I don't know.The text was updated successfully, but these errors were encountered: