grpc / grpc-web

gRPC for Web Clients
https://grpc.io
Apache License 2.0
8.65k stars 764 forks source link

Generator redeclares same function name when given a proto with multiple services #322

Open wyemun opened 6 years ago

wyemun commented 6 years ago

When give .proto file of such

...
service FirstService {
    rpc List (ObjectA) returns (ObjectA) {}
}

service SecondService {
    rpc List (ObjectB) returns (ObjectB) {}
}

The protoc generator will generate the following stub using mode=grpcwebtext

...
const methodInfo_List = new grpc.web.AbstractClientBase.MethodInfo(
  proto.servicename.ObjectB,
  ...
);

// and another one with the same name
const methodInfo_List = new grpc.web.AbstractClientBase.MethodInfo(
  proto.servicename.ObjectA,
  ...
);

which results in a SyntaxError

stanley-cheung commented 6 years ago

Acknowledged. Will fix. Thanks for the report!