It is important to understand that the serialisation of Protocol Buffers is made possible with these tags. Removing them could cause unexpected behaviours during deserialisation.
So be aware that removing these two fields and not using the reserved
keyword can break backward and forward compatibility. If a later version of your schema uses the 3 and 4 as tags and some old version of your code still use these tags as AccountToken
and BusinessToken
, you'll have unexpected behaviours.
in order to safely remove these fields, you can do:
message Foo {
reserved 3, 4;
...
}
and optionally you can reserve the field name so that the schema do not use the AccountToken
and BusinessToken
fields' name and thus don't conflict with your code (eg: you go back to older version of your code and a field is called business_token
but it doesn't have the same meaning anymore with the new schema). To do that you can do:
message Foo {
reserved 3, 4;
reserved "business_token", "account_token"; // assuming they are called like this
...
}
By doing the first step, and optionally the second, you ensure full compatibility (backward and forward).