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

Does Package name work? #39

Open
cajameslu opened this issue Nov 20, 2020 · 1 comment
Open

Does Package name work? #39

cajameslu opened this issue Nov 20, 2020 · 1 comment

Comments

@cajameslu
Copy link

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

@cajameslu
Copy link
Author

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.

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

1 participant