yapi icon indicating copy to clipboard operation
yapi copied to clipboard

带有multipart文件请求参数的openapi.json导入进yapi后,请求参数显示不正常

Open xyfAmo opened this issue 1 month ago • 1 comments

版本号

1.10.2

什么问题

我使用这个openapi.json(这是参数关键的一个部分,请求参数)导入进yapi后显示不正常 { "content": { "multipart/form-data": { "schema": { "type": "object", "properties": { "file": { "format": "binary", "type": "string" } } } } } } 期望显示: Content-Type:multipart/form-data Body中 file 类型为file 结果显示: Content-Type: application/json Body中 有一行参数,但是未显示任何名称和类型,只显示了一个非必须信息

如何复现此问题

~ 可以使用以下java代码,集成swagger3和springdoc(版本任意)生成openapi.json文件后导入yapi @Operation(summary = "上传文件") @PostMapping(value = "/test", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) public ResponseEntity<Object> test(@RequestPart(value = "file", required = false) MultipartFile file) { return new ResponseEntity<>(HttpStatus.OK); }

什么浏览器

~ chrome

什么系统(Linux, Windows, macOS)

macOS

xyfAmo avatar Jun 04 '24 10:06 xyfAmo