实现swagger2不显示类名

对swagger2进行扩展,实现自定义需求

使用场景

在使用swagger2 2.9.2时

在UI上接口旁边会显示类名,我需要把这个去掉


经debug之后,发现这个字段是通过springfox.documentation.spring.web.scanners.ApiListingReader显示的

而这个类是被自动注入到springfox.documentation.spring.web.plugins.DocumentationPluginsManager中的

因此,只需要自己实现一个ApiListingReader注入到spring容器就可以了


效果图


实现swagger2不显示类名
http://blog.inkroom.cn/2019/11/01/2EEH37B.html
作者
inkbox
发布于
2019年11月1日
许可协议