Skip to content
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

No longer generate register...Server function in pb.gw.go? #1195

Closed
chaowanggrab opened this issue Apr 3, 2020 · 2 comments
Closed

No longer generate register...Server function in pb.gw.go? #1195

chaowanggrab opened this issue Apr 3, 2020 · 2 comments

Comments

@chaowanggrab
Copy link

chaowanggrab commented Apr 3, 2020

I have protoc 3.11.4 and latest grpc-gateway

We used to run something like
protoc -I/usr/local/include -I. \ -I$GOPATH/src \ -I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \ --go_out=plugins=grpc:. \ --grpc-gateway_out=logtostderr=true:. \ --swagger_out=logtostderr=true:. \ example/echo_service.proto in order to update the apis.

Before, it generates Register...Server(ctx context.Context, mux *runtime.ServeMux, server {{$svc.GetName}}Server) error {} function (https://github.com/grpc-ecosystem/grpc-gateway/blob/master/protoc-gen-grpc-gateway/internal/gengateway/template.go#L564). However, now the generated pb.gw.go does not have the server related functions.

I simply follow the readme and it would not get to service related functions too. But I am not sure it's only happen on mine or not. I noticed in the examples folder, the server related functions are still occur in pb.gw.go.

Did I miss anything?

@johanbrandhorst
Copy link
Collaborator

Hi, that is very strange. Is it possible that you removed the http annotations from your protofile? It definitely should still be there. Maybe you could join the #grpc-gateway channel on gophers slack (https://invite.slack.golangbridge.org/) and I can help you debug it? This is not the right medium.

@chaowanggrab
Copy link
Author

chaowanggrab commented Apr 3, 2020

Yeah sure, thanks! I have pasted my question to the channel too.

Here is my protofile:
`syntax = "proto3";

package example;

import "google/api/annotations.proto";

message StringMessage {
string value = 1;
}

service EchoService {
rpc Echo(StringMessage) returns (StringMessage) {
option (google.api.http) = {
post: "/v1/example/echo"
body: "*"
};
}
}`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants