I am using MessageDifferencer API to compute difference between two Google Protobuf messages. I passed the below two messages to the API.--
name: "MSG1"
cfgMsg {
cfgName: "obj1"
msgId: 100
cfgObj {
uuid: "obj1_1"
node_id: "1.1.1.1"
intf_id: 100
}
cfgObj {
uuid: "obj1_2"
node_id: "2.2.2.2"
intf_id: 200
}
cfgObj {
uuid: "obj1_3"
node_id: "3.3.3.3"
intf_id: 300
}
}
name: "MSG2"
cfgMsg {
cfgName: "obj2"
msgId: 200
cfgObj {
uuid: "obj1_1"
node_id: "1.1.1.1"
vrf_id: 100
}
cfgObj {
uuid: "obj1_2"
node_id: "4.4.4.4"
vrf_id: 200
}
cfgObj {
uuid: "obj1_3"
node_id: "3.3.3.3"
intf_id: 300
}
cfgObj {
uuid: "obj1_5"
router_id: "5.5.5.5"
vrf_id: 500
}
Output from the Message Differencer API is as below.```Message Differences:modified: name: "MSG1" -> "MSG2"modified: cfgMsg.cfgName: "obj1" -> "obj2"modified: cfgMsg.msgId: 100 -> 200modified: cfgMsg.cfgObj[1].router_id: "2.2.2.2" -> "4.4.4.4"added: cfgMsg.cfgObj[3]: { uuid: "obj1_5" router_id: "5.5.5.5" vrf_id: 500 }```My question about this API is: Why does the output is in this format ? It is not really in any usable format for anyone who is calling this API. The calling application has to literally do a string parse to make sense of this output and conclude anything from the returned output. Also, this output will change depending on how the original message was defined so getting this parsing in a right way is pretty complex. In fact, even after parsing it is difficult to match with original message type with either FieldDescriptor, Reflection or Descriptor. Ideally, returning a new object of original message type with changed values would make more sense to me.Do I understand this API correctly or Am I interpreting the above API usage in a wrong way ? I don't know if this should be used in conjunction with any other API to make sense ?It will be really helpful for me and I really appreciate if any expect on this group could explain few details around this ?Thanks,Kiran
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 protobuf+u...@googlegroups.com.
To post to this group, send email to prot...@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
To view this discussion on the web visit https://groups.google.com/d/msgid/protobuf/b4b52541-8522-418f-9330-b3f839035947%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/protobuf/CADqAXr6tET2se3YW931UucnfFd4K%3DO82Laxsa0Z%3DyJ4ss7EsJA%40mail.gmail.com.