You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a Gateway service with dynamically created routes. I want it to expose its endpoints through Swagger UI. Since my routes are not static (they come and go as new services are registered and deregistered with Eureka), I can't do it purely with static yamls (like so). So what I did was:
providing routes corresponding to those urls; the routes simply forward to lb://SERVICE-NAME/v3/api-docs
// I'll omit that code
I won't provide all the code since it doesn't really matter, and I don't want to overwhelm you. I wanted to show you a general flow
But here's the thing: I already fetched those JSON docs to build my business routes (a route per endpoint), they are already stored in memory (and updated). I don't want to go through all that fuss just to let Swagger do that unnecessary extra work of fetching the docs again
Can I somehow give Swagger UI docs directly instead of telling it where to find them?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have a Gateway service with dynamically created routes. I want it to expose its endpoints through Swagger UI. Since my routes are not static (they come and go as new services are registered and deregistered with Eureka), I can't do it purely with static yamls (like so). So what I did was:
lb://SERVICE-NAME/v3/api-docs
// I'll omit that code
I won't provide all the code since it doesn't really matter, and I don't want to overwhelm you. I wanted to show you a general flow
But here's the thing: I already fetched those JSON docs to build my business routes (a route per endpoint), they are already stored in memory (and updated). I don't want to go through all that fuss just to let Swagger do that unnecessary extra work of fetching the docs again
Can I somehow give Swagger UI docs directly instead of telling it where to find them?
Beta Was this translation helpful? Give feedback.
All reactions