is it possible to have a request DTO model described in Swagger-UI if it was annotated by @RequestPart, not @RequestBody ?? I have an API which uploads a MultipartFile and additionally I have send a JSON with config at the same time. To make it work I had to use @RequestPart and swagger documentation seems not to handle it at all - in UI instead of full model description I have only "formData" object and that's all.
public void addPhoto(@RequestParam(FILE_PARAM) MultipartFile file,
@RequestPart("config") ConfigDTO configDTO) {
//code goes here
}
Dependencies I use:
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-bean-validators</artifactId>
<version>2.9.2</version>
</dependency>