如何从 Swagger UI 中删除控制器列表

2022-09-01 23:00:01

我使用的是 springfox-swagger-ui 2.8.0,它与 Swagger UI 3.7.0 一起提供。

我想摆脱api文档页面前面的控制器列表,这对我来说毫无用处(每个选项卡都是空的)。

我已经尝试用@ApiIgnore来注释控制器类,但当然这也删除了我需要的其余api文档。

基本上,我想删除它:

Controller list to remove/hide

同时保持此:

REST api docs to keep

我挖掘了在线文档,GitHub问题,StackOverflow问题,Google...无。我是唯一有此请求的人吗?


答案 1

在控制器上尝试此属性

[ApiExplorerSettings(IgnoreApi = true)]


答案 2

将属性描述添加到 :@Api

例如:

@Api(value = "Test API Controller", produces = MediaType.APPLICATION_JSON_VALUE, tags = {"test-api-controller"}, description = "Testing API") 

推荐