-
Notifications
You must be signed in to change notification settings - Fork 64
Open
Description
Hello! Is there an established way to annotate a generic file response? I am currently facilitating this using the OpenAPI decorator as below:
@Get("/file")
@OpenAPI({
responses: {
"200": {
description: "File response",
content: {
"application/octet-stream": {
schema: {
type: "file",
},
},
},
},
},
})Which does render the response I am looking for, however since no @ResponseSchema decorator has been specified, swagger also includes a blank application/json response option (which is not correct).
I have tried using the ResponseSchema decorator, rather than my current implementation, but specifying a contentType of application/octet-stream produces the following error:
C:\Users\JosephMoroney\Documents\FR2\ex-api\node_modules\routing-controllers-openapi\src\decorators.ts:133
source.responses[statusCode]?.content[contentType].schema
^
TypeError: Cannot read properties of undefined (reading 'schema')Any thoughts/ideas would be appreciated!
Metadata
Metadata
Assignees
Labels
No labels
