@ApiOperation(value = "Sample API")
@ApiImplicitParams(value = {
@ApiImplicitParam(dataType = "string", name = "x",, required = false, paramType = "form", allowMultiple = true),
@ApiImplicitParam(dataType = "__file", name = "y", , required = false, paramType = "form", allowMultiple = true)
})
@PostMapping(value = "/{upload}", consumes = MediaType.MULTIPART_FORM_DATA_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity upload(HttpServletRequest request) {
//process request
}
Unable to get below CURL equivalent using above Spring fox Swagger (2.9.2)
curl -X POST \
http://localhost:8080/upload \
-H 'Accept: application/json' \
-H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
-F 'x1=@path\1.txt' \
-F 'x2=@path\2.txt' \
-F x3=val3 \
-F x4=val4
Needed support for dynamic keys equivalent to a controller that could accept Map<String,String>
, Map<String,MultipartFile>
both.
Won't it be possible before Open API 3 support is added to springfox swagger ?