apiimplicitparam不显示在swagger ui中

relj7zay  于 2021-07-24  发布在  Java
关注(0)|答案(0)|浏览(321)

在我的swagger ui中,我想在我的一个方法中添加一个header参数字段,并在swagger ui文档中添加header,我正在使用@apimplicitparam,但它没有显示在swagger页面上。
这是我写的代码

@GET
@Produces(MediaType.APPLICATION_JSON)
@ApiImplicitParams({
        @ApiImplicitParam(name = "token", value = "employee token", paramType = "header", required = true, dataType = "string")
})
@ApiOperation("Fetch employees")
@ApiResponses(code = 500, message = "server error")
public List<Employee> getEmployees(@ApiParam("query string") @QueryParam("emp") String empId) {
      //.... implementation
}

你知道为什么方法签名中的注解不起作用吗。
请注意,我使用的是swagger core,版本1.5.1-m2和gradle。
api-com.wordnik.swagger.annotations注解

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题