我正在测试API并且必须获取文件(jpg和png)。为什么无法在Swagger上正确显示API结果图像以查看它是否正常工作?
我的代码
@ApiOperation(value = "Obter arquivos de permalink", response = FileSystemResource.class, produces = "image/png")
@RequestMapping(value = "{validacaoId}/{permalinkId}/permalink/{pecaFile}", method = RequestMethod.GET)
@ResponseBody
public FileSystemResource getFile(@PathVariable("validacaoId") String validacaoId,
@PathVariable("permalinkId") String permalinkId,
@PathVariable("pecaFile") String pecaFile) {
return new FileSystemResource(permalinkService.getFile(validacaoId, permalinkId, pecaFile));
}