oslabs-beta/tropicRPC

Does Package name work?

Opened this issue · 1 comments

Hi, this is nice plugin, but I wasn't able to make it work if the package name is Java style, like com.example.demo in the proto file. In sendgRPCRequest.ts, it tries to check if the grpcObject has a property of packageName {grpcObject.hasOwnProperty(protoPackage)}. This seems does not work on dot separated package name. I printed the grpcObject in jason format, it looks like below. So it won't have com.example.demo property, instead it has com, then example, then demo, etc.

{"com":{"example":{"demo":{"Name":{"format":"Protocol Buffer 3 DescriptorProto","type":{"field":[

However I'm not sure if there's an issue or I didn't use it correctly. Let me know your opinion.

Thanks!
James

I can confirm this an issue. Also if there's no package name specified, it won't work eight. I think the solution would be split the dot separated package name in an string array then loop the array to get nested objects from grpcObject. If package name is blank, the splitted array would be empty which will work too.