-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
grpc-gateway: do no require manual grpc gateway registration #22715
Comments
In addition to modules, we should allow the registration of the following routes in the server (extensible like the gRPC server): https://github.com/cosmos/cosmos-sdk/blob/v0.52.0-beta.2/runtime/app.go#L224-L231 |
I am interested in taking a stab at this! |
Cool, thanks! |
i'm not sure that this is possible with removing gateway code. the custom endpoint from if we keep the gw generated code, im still not sure how to proceed as the custom endpoint is not exported. it's used internally in the mux registration code. any idea on how to proceed here? is there an approach/element to this im missing? |
The idea was mainly to ditch that whole generated code, but keep the The gRPC gateway server (server/v2/api/grpc-gateway), would have a catch all handler to answer to any path, and that handler would dynamically try to figure out which message was aimed the request. For example:
That should work for most of them, this is when there are parameters that things get hacky:
Again, that server won't be pretty, and probably slower than with the generated code, but it is more important to have killed the generated code + sdk import in modules. gRPC gateway server is there for backward compat (as handlers do not work with it). The idea is to have everyone slowly migrate to rest v2. |
Follow-up of #22701, #20798
ref: #22701 (review)
While gRPC gateway has been wired in #22701, as said in the message above, the goal is to removal totally the grpc gateway manual registration from the modules. This still needs to be implemented.
The text was updated successfully, but these errors were encountered: