如何在swagger UI上显示图像?

时间:2015-05-13 17:40:51

标签: java spring swagger-ui

我正在测试API并且必须获取文件(jpg和png)。为什么无法在Swagger上正确显示API结果图像以查看它是否正常工作? Swagger UI

我的代码

@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));
    }

0 个答案:

没有答案