Status: New
Labels: Type-Defect Priority-Medium

New issue 332 by Allow for default values that are marked "set"

I understand that the "default" values are not marked as set (as stated in issue 249) -- and thus not included in the serialization. I would find it useful to have an additional choice to have the default value marked as set so that it does get serialized. While I'm not familiar with the code be hide protobuf, I imagine this would be handled when converting the .proto to a native format, with no run-time penalty to anyone who does not use the feature.

I am trying to ensure that a message id is always set for a each message, without the user having to explicitly set the field to the default value every time they wish to send it. Currently, I find myself having to reflect into the message in my Send routine (which only receives a generic Message), fetch the default value, and then use the reflection methods again to set the value.

I've read that the preferred/suggested method for working with protobuf's non-intehitance-based design is to include all possible messages as fields within a "main" message, but I do not personally care for that approach.

You received this message because you are subscribed to the Google Groups "Protocol 
Buffers" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

Reply via email to