-
Notifications
You must be signed in to change notification settings - Fork 119
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
Optional mentioned as default field rule in proto3 documentation #30
Comments
For Proto3, the |
We expanded the documentation in this area back in September, but it seems we have some more work to do to clarify the different use cases. Thank you for the thorough write-up about the confusion you're experiencing... it helps me to pinpoint the content that we need to fix/expand/enhance. I'll update this issue once we've pushed an update to the topic. |
Hello to both of you, Thanks for your replies, and the explanations. @esorot thanks for theses precisions, it made things a bit clearer, but I'm still confused about the Thanks again and have a nice day. Julie |
So "singular" might be the confusing thing here. It's really referring to a basic field(Not a Map or Repeated Field). It's the default rule because a user doesn't have to add any additional modifiers to a field for a field to be "singular". Think primitive vs arrays and maps. int, float, string, etc - these are primitive fields and thus "singular"
Example:
|
I think I get it now ! So Really, thanks again for these explainations, it seems much more clear to me now! |
Hello,
I'm learning about ProtoBuf and writing a POC with proto3 as protobuf syntax. While browsing the doc about Proto3 syntax and the Internet, I found some inconsistencies.
The documentation ProtobufDoc speaks of these 4 field rules :
singular
,optional
,repeated
andmap
,singular
being the default field rule.However, in an issue on gitHub here, it is said that
optional
has been removed as a field rule, and I understood that it was now the default rule (which is also claimed by both VSCode and WebStorm when I work with it).I don't find it clear which are the proto3 field rules, and which one is the default one : is it
singular
? is itoptional
? And if both are still in use in proto3, what is the difference between them ?I'm sorry if this is a duplicate, I did not found an issue about the presence of
optional
andsingular
in proto3 doc or the fact that both are claimed to be the default rule.Thanks a lot for all the work.
Julie
The text was updated successfully, but these errors were encountered: