I have a proto which has a message that contains extensions
message MsgA
{
extensions 10 to 50;
}
I have the other proto which has the extensions (showing only 1 of the extensions below)
extend MsgA
{
optional MsgB msgB = 10;
}
message MsgB
{
required int32 value = 1;
}
Through the protobuf code, I am able to get the Descriptor and FileDescriptor for MsgB and from there I am able to retrieve the extension "msgB" which is of type FieldDescriptor. I am finding the extensions through protobuf code vs using the generated code from the MsgB proto as I am trying to iterate through all of the extension messages vs hardcoding each of them into a MutableExtension. (I understand the hardcoded way of MutableExtension(MsgB::msgB) but want to use the retrieved extension)
I want to populate a mutable extension of MsgA with the msgB extension but MutableExtension takes in a type of
(const ::google::protobuf::internal::ExtensionIdentifier& id) or
(const ::google::protobuf::internal::ExtensionIdentifier& id, int index)
How can I populate/create MutableExtension with the found msgB extension or how do I create an ExtensionIdentifer of msgB to use as the input to create a MutableExtension of MsgA ?