-
Notifications
You must be signed in to change notification settings - Fork 653
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
Failed to generate pb file when using proto3 version. #1717
Comments
In addition, I saw that there are two official methods: dynamic and static. Is there any specific difference between the two? My colleague thinks static is better |
The description of how those files are generated in the example can be found here: https://github.com/grpc/grpc/tree/master/examples/node/static_codegen. In this context, "static" code generation refers to generating files ahead of time using |
@murgatroid99 Thank you so much for your guidance. |
@murgatroid99 Does the |
That is not working for you because the version of |
@murgatroid99 Hello, first of all thank you for helping me solve the problem. I don't use github very much. What is the link you sent? What should I do now, wait for npm to update the grpc-tool package? |
Thanks for the upgrade to support `optional in protoc v3.15! I saw the grpc-tools version has been bumped to v1.11, cloud you please publish this new version to NPM so that we can use it now? |
I have published grpc-tools version 1.11.0 to npm. |
Thank you so much, I appreciate it! |
@murgatroid99 @huan Thank you for your help.Maybe I trouble you, I read the official document, optional and singular mean the same. I should just remove the optional. |
@zhushenhang Thanks for the notice! Could you please share the link from the official document which is talking about "optional and singular mean the same"? From my understanding, the According to the How To Implement Field Presence for Proto3:
So it seems that the |
@huan
Is my understanding wrong? I use proto not for long. A lot of things I do not really understand, thank you for your guidance |
I don't think they are same. As my understanding, what is same is that they can all be absence. The difference is that you can not check presence/absence for |
Now I get it! thank you @huan |
May I ask you another question, how to set the value of map type in static code?
I have a map structure like this.
StringVec provides a set method and a get method, so I can use it like this.But Maps and AudioChannelCountMapBitrateOptions only provide the get method, like getFormatmapchannelcountMap,getBitratemapMap.
But currently I only got |
I have not used the |
@murgatroid99 Hi, it seems that the Log messages:
Reproduce repo: |
@huan yes,I tested it and the problem still exists. |
@zhushenhang Thank you very much for the confirmation! @murgatroid99 Could you please confirm this problem and re-open this issue if it does? or should we create a new issue for tracking the future fix? |
I have published another fix in version 1.11.1 that addresses that error. |
@murgatroid99 thank you |
Thank you so much for the quick fix! |
Problem description
Failed to generate pb file when using proto3 version.
UHDInterface.proto: is a proto3 file that contains optional fields, but code generator protoc-gen-grpc hasn't been updated to support optional fields in proto3. Please ask the owner of this code generator to support proto3 optional.--grpc_out
Reproduction steps
Environment
Additional context
I used grpc to build the client and server for the first time and learned the official example. I see the following two files: helloworld_pb and helloworld_grpc_pb.I did not find an official example of generating these two files. I found other information. I would like to ask, how do we generally generate these two files now?
The text was updated successfully, but these errors were encountered: