spring-cloud-gateway icon indicating copy to clipboard operation
spring-cloud-gateway copied to clipboard

Swagger route locator

Open samtonyclarke opened this issue 7 years ago • 4 comments

Suppose we have some of end points in some micro service...end point 1 to end point 5. But only end point 2 and 4 should be exposed externally.

Would it make sense to implement a predicate which uses some swagger definition to determine if the route should be applied? In this example the swagger would expose only the paths associated with end point 2 and 4.

samtonyclarke avatar Jan 24 '18 03:01 samtonyclarke

I did have the thought to have a swagger route locator.

spencergibb avatar Jan 30 '18 00:01 spencergibb

We have implemented a predicate based on basePath + paths + http method defined from swagger 2.0 definition. We would need to clean it up to submit back to scg.

tony-clarke-amdocs avatar Jan 14 '20 19:01 tony-clarke-amdocs

yeah, I saw that. I think folks would be interested.

spencergibb avatar Jan 14 '20 19:01 spencergibb

I have published an OpenAPI Route Definition Locator for Spring Cloud Gateway which creates route definitions dynamically based on OpenAPI (aka Swagger) definitions served by backend (micro)services. I thought it might scratch an itch others are having, too. I'd be interested in feedback (including feature requests).

jbretsch avatar Jun 18 '22 07:06 jbretsch