Neither are appropriate in my use case unfortunately. I want to be
able to tag any message with data in a field range special within the
organization. The point is that I don't want to add fields to the
existing hundreds and hundreds of message types we have already.
For the time being, I have switched everything back to proto2, which
despite some inconvenience I believe is more feature complete and
superior to proto3 at this time.
On Fri, Mar 18, 2016 at 4:20 PM, 'Feng Xiao' via Protocol Buffers
> On Tuesday, March 15, 2016 at 12:32:07 PM UTC-7, Jeremy Ong wrote:
>> Hi google pb,
>> I was wondering if an interface exists for specifying that I do not want
>> the proto3 serialization or deserialization to discard unknown fields. My
>> understanding was that this change was made from proto2 to proto3, and is a
>> pretty severe restriction if there are no ways around it. The motivating
>> example in my case is to potentially decorate a message with fields in the
>> extension ranges that are not part of the message body. The meaning is
>> purely semantic and I do not want the data therein to be contained in the
>> protobuf format itself. If unknown fields are not an option, are there other
>> options or suggestions to handle this?
> Some alternatives to consider:
> 1. use a bytes field to store these data, and decode it manually if it's a
> 2. use an google.protobuf.Any field for it if the data is still a protobuf
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to protobuf+unsubscr...@googlegroups.com.
> To post to this group, send email to firstname.lastname@example.org.
> Visit this group at https://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
To post to this group, send email to email@example.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.