Closed eldad87 closed 2 years ago
Hi! Thanks for your issue. There are a few ways to do this already: The ServeMux implements http.Handler
, so you can register it on a http.ServeMux, and then manually register your own routes on the serve mux too. Alternatively, you can also call ServeMux.Handle to register custom routes on the serve mux. In either case, it's going to be manual, and risk getting out of date with your definitions. If you require something generated from your definitions, I recommend looking at a tool like https://github.com/OpenAPITools/openapi-generator and seeing if you can somehow merge such a server with our ServeMux. Does that make sense?
Hi @johanbrandhorst, Thank you for your answer. Instead of generating the custom routes, I would try to utilize something like kusk-gateway.
kusk-gateway appears to be an external application. I don't know what you mean by "register" open API routes in the context of using an external application. What exactly are you wanting our gateway to do?
Hi @johanbrandhorst , Assuming that my eco-system is composed of 2 micro-services & a gRPC-gateway service:
Currently, the gRPC-gateway can expose the APIs of micro-service A, while I would like it to expose both A & B.
You have to manually add those routes to the same mux that the gRPC gateway serves. The gRPC gateway can't automate this process.
🚀 Feature
As a SaaS provider, I would like to serve my APIs using a single endpoint. Unfortunately, using grpc-gateway is not an option as some of our legacy microservies are "documented" using OpenAPI (Swagger).
Please provide an ability to register OpenAPI based handlers. As a workaround, I result using an additional API-GW (AWS, WSO2, Kong, etc) that consolidate my Restfull APIs (OpenAPI) and grpc-gateway(s).