官方文档

https://springdoc.org/ 

官方DEMO

https://github.com/springdoc/springdoc-openapi-demos 

问题描述

 

解决方案 

    @RequestMapping(value = "/t",method = {RequestMethod.POST},headers = "content-type=multipart/form-data")
    public ResponseBean ocr(@ApiParam(value="文件",required=true)@RequestPart("file") MultipartFile file){
        return ResponseBean.error();
    }

参考文章

Swagger3.0文件上传,接收file类型时显示string解决办法

swagger文件上传处理的正确写法

swagger 和 spring boot 实现文件上传

Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐