Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/325.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何在swagger UI上显示图像?_Java_Spring_Swagger Ui - Fatal编程技术网

Java 如何在swagger UI上显示图像?

Java 如何在swagger UI上显示图像?,java,spring,swagger-ui,Java,Spring,Swagger Ui,我正在测试API,必须获取文件(jpg和png)。为什么不能在Swagger上正确显示API结果图像以查看它是否正常工作? 我的代码 @ApiOperation(value = "Obter arquivos de permalink", response = FileSystemResource.class, produces = "image/png") @RequestMapping(value = "{validacaoId}/{permalinkId}/permalink/{

我正在测试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));
    }