There should be no reason you can't use proto3 along with proto2 just fine. The underlying serialization is compatible, one major difference if you care about encoding options is that proto3 has packed fields on by default for repeated, but this can also be manually enabled for repeated fields in proto2.
Also, proto2 has extensions whereas proto3 does not. There should be no interop issues. I am less familiar with this enum incompatibility issue, that seems odd to me since I imagine this if anything would be target language related and not inherently a proto2 to proto3 limitation. There's some rules about what the zeroth item must be, but that's all I can think of: https://developers.google.com/protocol-buffers/docs/proto3#enum On Fri, Mar 26, 2021 at 7:08 AM David Gomez <[email protected]> wrote: > I work at Google and I can tell you that proto2 and proto3 freely > interoperate. That is, they can reference symbols across versions and > generate code that works well together. It is entirely reasonable for a > proto2 message to reference a proto3 enum or message, and vice versa, with > the exception that proto3 messages cannot reference proto2 enums due to > differences in semantics. > > On Fri, Mar 26, 2021 at 9:34 AM [email protected] <[email protected]> wrote: > >> Hi folks. >> >> I just noticed that proto3 got optional fields >> <https://github.com/protocolbuffers/protobuf/releases/tag/v3.15.0>. At >> my workplace, Square, we've been stuck on proto2 forever, because we have a >> mountain of protos that both optional fields and proto option annotations >> all over the place. >> >> Is there an up-to-date summary of the remaining differences between >> proto2 and proto3? If proto3 is converging on full proto2 functionality >> support, there's a chance we could migrate to proto3, which would be >> extremely helpful: proto3 seems better supported in Ruby, for example. >> >> Thanks, >> >> Zellyn Hunter >> >> -- >> 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/45733f56-a82b-4f1e-84bc-71d55e7ef78bn%40googlegroups.com >> <https://groups.google.com/d/msgid/protobuf/45733f56-a82b-4f1e-84bc-71d55e7ef78bn%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/CAOj%3Dy3_XGMGJdKyDww%2BQ0Tvj_7vGWwPDtMZi6e0B0D%3De3TyWVw%40mail.gmail.com > <https://groups.google.com/d/msgid/protobuf/CAOj%3Dy3_XGMGJdKyDww%2BQ0Tvj_7vGWwPDtMZi6e0B0D%3De3TyWVw%40mail.gmail.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/CAD7-yfsw_sPUKkuE32JqOr_7VXcgup51ag6XPrjbZOc5ae5%3DKQ%40mail.gmail.com.
