The requirement is a user will upload files to spring boot (ReST request) using angular. The ReST interface store the file into gitlab for further processing. Using @RequestPart annotation, content with a different name will be retrieved from a request and placed into Gitlab. The ReST implementation as follows:
@ApiOperation(value = "Upload java files into Gitlab")
@RequestMapping(method = RequestMethod.POST, consumes = MediaType.MULTIPART_FORM_DATA_VALUE,
produces = "application/json")
@ApiResponses(value = { @ApiResponse(code = 200, response = CustomResponse.class, message = "Success"),
@ApiResponse(code = 400, response = ErrorResponse.class, message = "Bad Request"),
@ApiResponse(code = 500, response = ErrorResponse.class, message = "Internal Server Error") })
public CustomResponse uploadJava(
@ApiParam(value = "Interface", required = true)
@RequestPart(name = "interface", required = true) final MultipartFile interfaceClass,
@ApiParam(value = "Java Class", required = false)
@RequestPart(name = "javaClass", required = false) final MultipartFile javaClass) {
return null;
When I access the Swagger UI, couldn't find description and example
I found the following in github forum stating that it will resolve the above issue
@parameter( description = "This is the configuration", content = @content(mediaType = MediaType.APPLICATION_JSON_VALUE))
But it didn't.
My question is,
- How to add description and example for the above. (Similar to RequestParam)
- How to set content type for each file.
Swagger dependency in my project:
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
<version>3.0.0</version>
</dependency>
The requirement is a user will upload files to spring boot (ReST request) using angular. The ReST interface store the file into gitlab for further processing. Using @RequestPart annotation, content with a different name will be retrieved from a request and placed into Gitlab. The ReST implementation as follows:
When I access the Swagger UI, couldn't find description and example
I found the following in github forum stating that it will resolve the above issue
@parameter( description = "This is the configuration", content = @content(mediaType = MediaType.APPLICATION_JSON_VALUE))
But it didn't.
My question is,
Swagger dependency in my project: