#How to use swagger when upload multi files by @UploadFiles()

4 messages · Page 1 of 1 (latest)

last hawk
#

I already read nestjs/swagger 's issue. But, I can't choose best way to use swagger when upload multi files.
Do you have any clear way to solve it?

dark cedar
#

what if you add @ApiConsumes('multipart/form-data') to the controller's method?

last hawk
#
@ApiTags('file')
@Controller('file')
export class FileController {
  @ApiConsumes('multipart/form-data')
  @Post('upload')
  @UseInterceptors(FileInterceptor('files'))
  uploadFile(@UploadedFiles() files: Express.Multer.File[]) {
    console.log('files', files);
  }
}
#

Here is my code. But swagger didn't response like this.