Context is a microservice architecture built with Micronuat that has a api gateway infront of them. Each microservice generates a swagger but that swagger is not correct because of the api gateway infront of them that does handle a few things like authorization and some path rewrites. The api gateway is also built on micronaut and is generic.
What is the best way to make sure that the swagger has the correct details for a integrator outside of our environment. The correct detials for how to authenticate and the correct path of the endpoint?
The things I am thinking of without knowing if it’s possible would be to have some post-process of the swagger to let it go through some logical updates:
- If path starts with X change it to Y.
- Always set the autentication to be XYZ.
- etc.
OR
In the controller anotate with how it works outside of the gateway:
- Some annotation for authentication?
- Some annotation to rewrite path for a method?
Thanks!