-
Notifications
You must be signed in to change notification settings - Fork 58
Closed
Description
grpc_tools_node_protoc automatically uppercases enum keys, whereas grpc_tools_node_protoc_ts maintains whatever casing is in the proto file. The mismatch causes typescript errors when using the javascript enum correctly.
Example repo here: https://github.com/TLadd/example-grpc-enum.
Proto file: https://github.com/TLadd/example-grpc-enum/blob/master/helloworld.proto#L32
message HelloRequest {
enum Value {
hello = 0;
hi = 1;
}
string name = 1;
HelloRequest.Value value = 2;
Generated js: https://github.com/TLadd/example-grpc-enum/blob/master/helloworld_pb.js#L160
proto.helloworld.HelloRequest.Value = {
HELLO: 0,
HI: 1
};
Generated ts:
https://github.com/TLadd/example-grpc-enum/blob/master/helloworld_pb.d.ts#L33
export enum Value {
hello = 0,
hi = 1,
}
Metadata
Metadata
Assignees
Labels
No labels