Centralize Swagger at one place for All microservices

Viewed 359

I have 10 microservices each having multiple REST API. For now I have configured swagger independently for each microservices. Problem is we have 10 different swagger urls ,1 for each microservices.

We also have eureka server and zuul gateway.

My question is how can I centralize swagger url at one place i.e I have only 1 swagger url for all the microservices .Whats the best approach and how can i do it?

I am using spring boot .

1 Answers

It can be done by using custom proxy rules that will point to the individual swagger page from the common URL.

http://<APP_URL>/swagger/<SERVICE_A> ->http://<APP_A_IP>:/api/swagger-ui/index.html http://<APP_URL>/swagger/<SERVICE_B> -> http://<APP_B_IP>:/api/swagger-ui/index.html

Related