DJViking
DJViking

Reputation: 872

Spring Boot: Combine multiple applications SwaggerUI?

Having about 6 Spring Boot applications with REST APIs running with Actuator and Prometheus support.
These are running on Docker, but the actuator port is not exposed.
Although we can connect each application actuator to an Prometheus and Grafana instance.

On of the application has OpenAPI documentation with SwaggerUI. This SwaggerUI is exposed through Actuator management port.

<dependency>
    <groupId>org.springdoc</groupId>
    <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
    <version>2.8.5</version>
</dependency>

Now I want to make similar OpenAPI documentation for the other applications.
However having our users to deal with 6+ different URLs for accessing the various OpenAPI documentation is not a good solution.

Is there any way I can combine all the SwaggerUIs OpenAPI definitions into one single SwaggerUI something similar as I do with Actuator and Prometheus?

Otherwise I was thinking the only way is to have each application generate an openapi.json for its APIs, then "somehow" export this file to a running SwaggerUI application (running on docker).
I can generate an openapi.json for each application with the springdoc-openapi-maven-plugin.

Upvotes: 0

Views: 13

Answers (0)

Related Questions