Skip to content

Implements

uhfun edited this page Jan 15, 2020 · 3 revisions

Springfox扩展

Springfox在启动时注入了所有 RequestHandler 的实现类, 后续都是根据这个Provider提供的RequestHandler来查找生成文档

 @Autowired
  public DocumentationPluginsBootstrapper(
      DocumentationPluginsManager documentationPluginsManager,
      List<RequestHandlerProvider> handlerProviders,
      DocumentationCache scanned,
    	...) {
    
  }

官方只有针对mvc场景下的 WebMvcRequestHandlerProvider 的实现

1.0.2-SNAPSHOT 以下可能命名稍有不同 swagger-more 添加了对于暴露的dubbo api的接口实现 com.github.uhfun.swagger.springfox.DubboApiRequestHandler 以及其他对于用于构造api文档的一些扩展

com.github.uhfun.swagger.springfox.ApiMethodModelsProvider
com.github.uhfun.swagger.springfox.ApiMethodReader
com.github.uhfun.swagger.springfox.ApiParamReader
com.github.uhfun.swagger.springfox.ApiTagReader
com.github.uhfun.swagger.springfox.DubboApiRequestHandler
com.github.uhfun.swagger.springfox.DubboApiRequestHandlerProvider
com.github.uhfun.swagger.springfox.ModelExtendsBuilder

SpringMVC扩展( version >= 1.0.2-SNAPSHOT)

根据Dubbo Service以及文档注解信息生成RequestMapping, 暴露http接口

com.github.uhfun.swagger.webmvc.DubboHandlerMethod
com.github.uhfun.swagger.webmvc.DubboHandlerMethodMapping
com.github.uhfun.swagger.webmvc.DubboMethodMessageConverterResolver