springdoc / springdoc-openapi-demos

Demo for OpenAPI 3 with spring-boot
http://springdoc.org
Apache License 2.0
493 stars 267 forks source link

How to serve API spec from multiple services #18

Closed tzieleniewski closed 4 years ago

tzieleniewski commented 4 years ago

Hi Team,

We have a API Gateway and we want to serve the documentation for multiple microservices behind it. We are using Spring Boot 2.2.x. We tried the springdoc.swagger-ui.urls[0].url but the missing CORS headers block us. Is there any other way to do that. May you please point us some other way/example how to achieve that.

All the best

bnasslahsen commented 4 years ago

Hi @tzieleniewski,

This is sample code, how to serve multiple microservices behind spring cloud gateway: