I believe `oneof` is supported in protobuf 2.6.1 [1], so we wouldn't need to upgrade to make use of it. But I agree that upgrading to protobuf 3 (while continuing to use the proto2 language version) is worth doing at some point.
Neil [1] https://groups.google.com/forum/#!topic/protobuf/lvI8-sWZbUY/discussion On Sun, Dec 18, 2016 at 4:31 PM, Michael Park <mp...@apache.org> wrote: > According to this thread > https://groups.google.com/forum/m/#!topic/protobuf/p4WxcplrlA4, > > It would involve us upgrading proto to 3.0.0 (which does not mean proto3). > It seems like we would also get `oneof` which would also be very useful for > us. > > On Sun, Dec 18, 2016 at 11:00 AM Jie Yu <yujie....@gmail.com> wrote: > >> Looks like Map is already supported in proto2: >> >> >> https://developers.google.com/protocol-buffers/docs/reference/cpp-generated#map-fields >> >> >> >> It'll greatly simply our json parsing in a few cases (e.g., converting from >> >> OCI image configuration to a protobuf definition for key->value json >> >> object): >> >> >> >> "annotations" : { >> >> "key1" : "value1", >> >> "key2" : "value2" >> >> } >> >> >> >> Previously, it's not possible to have a protobuf scheme for such a json. >> >> >> >> Thoughts? >> >> >> >> - Jie >> >>