Comment #2 on issue 332 by marc.gravell: Allow for default values that are marked "set"
http://code.google.com/p/protobuf/issues/detail?id=332

If I understand the issue correctly, then in v2, this is resolved via the `TypeModel` instance's `UseImplicitZeroDefaults` - so typically, adding:

    RuntimeTypeModel.Default.UseImplicitZeroDefaults = false;

somewhere early in your code (before any serialization etc) should do the job. Have I understood correctly?

This can (including v1) also be applied an an individual basis, for example:

     [ProtoMember(1, IsRequired = 1)]

which can also be achieved via DataMemberAttribute.

If I have misunderstood, please clarify - for example, does this relate perhaps to the code emitted from .proto? (in which case, changing to `required` may help).

--
You received this message because you are subscribed to the Google Groups "Protocol 
Buffers" group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.

Reply via email to