Renaming Fields

8,465 views
Skip to first unread message

Cameron

unread,
Nov 18, 2010, 4:56:31 PM11/18/10
to Protocol Buffers
I'm pretty sure I already know the answer to this, but I haven't found
it spelled out anywhere so I wanted to ask to be sure:

Can you change or rename a field name without affecting backwards
compatibility?

I assume the answer is yes because you qualify a field with a tag
number. Field names are just for the compiled java/cpp/py files that
are generated, correct?

Jason Hsueh

unread,
Nov 18, 2010, 5:12:21 PM11/18/10
to Cameron, Protocol Buffers
Yes, renaming fields is a wire compatible change. You might break things that use human readable formats like TextFormat, and of course any code that references the old field name.


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


Marc Gravell

unread,
Nov 18, 2010, 5:12:38 PM11/18/10
to Cameron, Protocol Buffers
As far as the binary encoding is concerned, it won't care. Obviously any code involved would need to be changed, and it *might* impact the text-based encoding (I don't know for sure; I simply don't use this encoding).

Marc

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




--
Regards,

Marc
Reply all
Reply to author
Forward
0 new messages