As long as you aren't using `Any`: then at the binary payload data it won't
be visible. Any existing code that uses the generated types will need to be
updated, obviously.

On Thu, 20 Apr 2023, 07:00 'Felik' via Protocol Buffers, <
[email protected]> wrote:

> Hello,
>
> I came to understand that the binary serialization only concern of field
> identifiying number (hence renaming field and message is backward
> compatible).
>
> I would like to confirm my understanding if following case is also
> backward compatible (I could not find any resource that discuss about this,
> or I may have used the incorrect search term for this).
>
> Let's say previously I have defined a nested proto definition as follow:
>
> message OuterProto {
>    message InnerProto {
>       optional bool field_bool = 1;
>       optional int64 field_int = 2;
>    }
>
>    optional InnerProto field_composed = 1;
> }
>
> Now, I would like to "un-nest" the InnerProto definition by redefining
> another duplicate proto in top level as follow:
>
> // same exact field numbering & type
> message NewInnerAsTopLevelProto {
>       optional bool field_bool = 1;
>       optional int64 field_int = 2;
> }
>
> Would following modification to message OuterProto be backward-compatible
> ?
>
> message OuterProto {
>    message InnerProto {    // unused
>       optional bool field_bool = 1;
>       optional int64 field_int = 2;
>    }
>
>    optional NewInnerAsTopLevelProto field_composed = 1;
> }
>
> Any input & insight would be much appreciated. Thank you!
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/protobuf/40a99e57-b80e-4bff-bf41-0622046ec12fn%40googlegroups.com
> <https://groups.google.com/d/msgid/protobuf/40a99e57-b80e-4bff-bf41-0622046ec12fn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/CAF95VAzziS8UL%3DwdVtS5jpTHbzfu7ux%2BRR2UtGQ4wzmLJYwX8w%40mail.gmail.com.

Reply via email to