You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2020/11/16 10:54:05 UTC

[GitHub] [servicecomb-java-chassis] liubao68 edited a comment on issue #2058: 上传文件的参数

liubao68 edited a comment on issue #2058:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2058#issuecomment-727902076


   我自己测试了下,没有发现问题。 你用的哪个版本?能否提供一个重现的 DEMO ?
   
   
   BTW: 使用 `ResponseEntity` , 需要指定类型, 比如  `ResponseEntity<String> `
   
   我的接口定义:
   
   ```
     @PostMapping(path = "/upload", produces = MediaType.TEXT_PLAIN_VALUE)
     public String uploadFile(@RequestPart(name = "fileName") MultipartFile file) {
         return fileService.uploadFile(file);
     }
   ```
   
   生成的 swagger :
   
   ```
     /upload:
       post:
         operationId: "uploadFile"
         consumes:
         - "multipart/form-data"
         produces:
         - "text/plain"
         parameters:
         - name: "fileName"
           in: "formData"
           required: true
           type: "file"
         responses:
           "200":
             description: "response of 200"
             schema:
               type: "string"
   ```
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org