如何从 Swagger UI 中删除控制器列表 [英] How to remove controller list from Swagger UI
问题描述
我使用的是 springfox-swagger-ui 2.8.0,它随 Swagger UI 3.7.0 一起提供.
I'm using springfox-swagger-ui 2.8.0 which ships with Swagger UI 3.7.0.
我想去掉 api 文档页面前面的控制器列表,对我来说很没用(每个选项卡都是空的).
I want to get rid of the controller list in front of the api documentation page, pretty useless for me (every tab is empty).
我已经尝试使用@ApiIgnore 注释控制器类,但是当然这也删除了我需要的其余 api 文档.
I've already tried to annotate the controller class with @ApiIgnore, but of course this removes the rest api documentation as well, which I need.
基本上,我想删除这个:
Basically, I want to remove this:
同时保持这个:
我翻遍了在线文档、GitHub 问题、StackOverflow 问题、谷歌……什么都没有.只有我提出这个要求吗?
I digged through online docs, GitHub issues, StackOverflow questions, Google... nothing. Am I the only with this request?
推荐答案
在@Api
中添加属性说明:
例如:
@Api(value = "Test API Controller", produces = MediaType.APPLICATION_JSON_VALUE, tags = {"test-api-controller"}, description = "Testing API")
这篇关于如何从 Swagger UI 中删除控制器列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!