在Swagger文档中考虑zuul路线

rid*_*ddy 7 swagger swagger-ui spring-boot netflix-zuul

是否可以考虑将zuul过滤器(手动或自动)显示在招摇中?

问题如下:我们有一个微服务,该微服务是我们应用程序的单入口,并包含所有昂首阔步的文档。实际上,它就像一个fasade,因此它将请求路由到我们应用程序内的相应微服务。不幸的是,zuul有时会在路由中添加或删除某些内容。因此,大头针的文档是不正确的,因为基本路径略有不同。

有没有可能影响这一点?

swagger记录表用于简单查找:

@Bean
public Docket swaggerSpringfoxDocket() {
    this.log.debug("Starting Swagger");
    StopWatch watch = new StopWatch();
    watch.start();
    Docket docket = new Docket(DocumentationType.SWAGGER_2)
            .apiInfo(apiInfo())
            .forCodeGeneration(false)
            .select()
            .paths(regex("/api/.*"))
            .build();
    watch.stop();
    this.log.debug("Started Swagger in {} ms", watch.getTotalTimeMillis());
    return docket;
}
Run Code Online (Sandbox Code Playgroud)