> On May 18, 2016, at 10:01 PM, Jeremy Ong <[email protected]> wrote: > > Why does adding JSON require dropping unknown fields? So long as fields are > keyed to field number, I don't see why the JSON encoding requires special > treatment with respect to the binary one.
JSON fields aren’t keyed to field number. They’re keyed to field name. Even apart from field naming, JSON and protobuf wire formats don’t correspond 1:1, so you can’t even correctly translate the primitive values without the schema. > However, proto3 makes breaks in compatibility with the underlying data > (proto2 encoded), which is where I find myself in disagreement. What do you think is different? Having decoded (by hand) a fair bit of proto2 and proto3 data, they look exactly the same to me. As I mentioned before, if preserving unknown fields is essential for you, you should stick with proto2. It’s still around and will be for a long time. Cheers, Tim -- 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/protobuf. For more options, visit https://groups.google.com/d/optout.
