问题描述
我是使用jersey框架进行UI开发的新手。我正在寻找解决以下问题的方法。
问题:无法从Swagger UI中删除/隐藏主体参数。有关详细信息,请参阅随附的swagger-ui屏幕。
请找到我的Java源代码:
@POST @Path("/createSchedule")
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces({ MediaType.APPLICATION_JSON })
@ApiOperation(httpMethod = HttpMethod.POST,value = "Create a new export schedule(s)") @ApiImplicitParams({ @ApiImplicitParam(name = "file",value = "Upload the template (.xlsx) to create schedule(s).",required = true,dataType = "file",paramType = "formData") })
public Response createSchedule(@FormDataParam(value="file") InputStream inputStream,@FormDataParam(value="file") FormDataContentdisposition fileMetaData) throws ScheduleException {
********* Code to process the uploaded file. **********
}
我使用了Jersey 2.29.1(jersey-container-servlet)和Swagger 1.5.0(swagger-jaxrs)API。还要让我知道如何只允许特定的文件扩展名(例如.xlsx)从swagger ui上传。
提前谢谢!干杯!