使用标签的Springfox swagger-ui端点重复

问题描述 投票:1回答:1

在我的带有springfox swagger 2.9.2的spring-boot项目中,我已经用RestController注释了控制器

@RestController
@RequestMapping("/rest/api/v1/auth")
public class AuthenticationResource {

    @ApiOperation(value = "Authenticate user", tags = {"Authentication"})
    @PostMapping("login")
    public void login(@RequestBody @Valid LoginDto loginDto) {
        ...
    }
}

将标签添加到ApiOperation之后,我在swagger-ui中获得了重复的端点。我的身份验证资源为空,没有任何端点,身份验证资源为登录端点。

enter image description here

enter image description here

这在较早的摇号版本中没有发生。如何从swagger-ui删除空api?

谢谢

java swagger swagger-ui swagger-2.0 springfox
1个回答
0
投票
根据GitHub上的this帖子,将@Api(tags = { "Authentication" })添加到Controller将解决您的问题。我尝试过,它有效。
© www.soinside.com 2019 - 2024. All rights reserved.