2

We are running set of micro-services and each are exposing open-api spec to url like the following.

https://{domain}/v1/membership/v3/api-docs
https://{domain}/v1/storage/v3/api-docs
https://{domain}/v1/order/v3/api-docs

The url opens open-api json (not UI).

Does anyone know of a tool where I can combine these and be able serve all the apis via url like https://{domain}/v1/apis with UI?

I looked Google and all I saw required me to create a single json file with all apis instead of dynamically serving these.

hinewwiner
  • 627
  • 13
  • 25
  • Instead of merging the OpenAPI files, you can have a [single Swagger UI page for multiple APIs](https://stackoverflow.com/a/44819386/113116). This configuration exists in standalone Swagger UI, not sure about springdoc-openapi-ui configs. – Helen Nov 25 '20 at 06:44

1 Answers1

0

You can use the property urls:

springdoc.swagger-ui.urls[0].name = first
springdoc.swagger-ui.urls[0].url = /firstAPI.yaml

springdoc.swagger-ui.urls[1].name = second
springdoc.swagger-ui.urls[1].url = /secondAPI.yaml

You can find this property in the documentation. There is also a nice FAQ for this question:

The properties springdoc.swagger-ui.urls.*, are suitable to configure external (/v3/api-docs url). For example if you want to agreagte all the endpoints of other services, inside one single application. Don’t forget that CORS needs to be enabled as well.