I am building a web app with nestjs(typescript).
Right now, I am working on swagger, and wonder how I can declare response type as 'file'
(this API will return a file as a response)
@Get('download')
@ApiBearerAuth()
@ApiResponse({ status: 200, type: 'file' })
@ApiOperation({ description: 'file download' })
async download(@Body() downloadFileDto: DownloadFileDto) {
//do something and return file
return;
}
I've tried this, but I am getting an error:
Resolver error at paths./api/file/download.get.responses.200.content.application/json.schema.$ref
Could not resolve reference: #/components/schemas/
question from:
https://stackoverflow.com/questions/65895568/how-to-declare-response-type-as-file-on-nestjs-swagger 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…