如何从Java注释生成文件选择器到swagger-ui

时间:2018-06-05 17:12:12

标签: swagger swagger-ui

我试图从java代码生成swagger-ui,但我无法在文件上传示例中生成文件选择器。

/**
 * The endpoint for uploadConfigurations.
 * This method receives a zip zipFile with configurations and create/update all on database.
 *
 * @param zipFile the configurations files.
 * @return response @{link Response}
 * @throws InvalidConfigurationException if configuration is invalid.
 */
@ApiOperation(value = "Upload and create/update configuration files ziped.",
        notes = "Inside zip must be N configuration files.")
@ApiResponses(value = {
        @ApiResponse(code = 200, message = "Successful operation."),
        @ApiResponse(code = 400, message = "Request parameters not acceptable."),
        @ApiResponse(code = 500, message = "Internal Server Error.")
})
@POST
@Consumes(MediaType.APPLICATION_OCTET_STREAM)
@Produces(MediaType.APPLICATION_JSON)
@Path("/configurations/upload")
public Response uploadConfigurations(final byte[] zipFile) throws InvalidConfigurationException {
    LOG.debug("Received configuration files to save...");
    this.configurationService.createOrUpdateConfiguration(zipFile);
    LOG.debug("Configuration files saved!!!");
    return Response.ok().build();
}

我需要这样的东西但不改变方法签名: See example

0 个答案:

没有答案