Consider zuul route in Swagger documentation
Asked Answered
H

0

8

is it possible to consider the zuul filter (manual or automatic) to show in the swagger?

The issue is the following: we have a microservice which is the single point of entry for our application and which holds all swagger documentation. in fact it works as a fasade, so it routes the request to the corresponding microservices inside our application. Unfortunately, zuul sometimes it adds something to the route or removes something. therefore the swagger documentation is incorrect, as the base-path is slightly different.

is there any possiblity to influence this?

swagger docket is used with simple lookup:

@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;
}
Honeysucker answered 23/1, 2018 at 15:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.