Why does ParseFromArray is not Failing ? (C++ , ProtoBuf Version 2.6.1)

57 views
Skip to first unread message

SAMEER CHAUDHARI

unread,
Nov 24, 2016, 10:15:56 AM11/24/16
to Protocol Buffers
Hi ,

Language :=>           C++
Proto Compiler :=>   2.6.1
API :=>                   ParseFromArray

Why does parseFromArray is not failing when passed with valid different  ProtoBuff message ?




Adam Cozzette

unread,
Nov 28, 2016, 11:25:53 AM11/28/16
to SAMEER CHAUDHARI, Protocol Buffers
Just to make sure I understand, are you saying you are taking a serialized message of some type A and attempting to parse it as a different type B and you are wondering why it is succeeding despite the mismatch? If so, the answer is that protocol buffers are designed to allow schemas to evolve over time and so it is typical and expected to come across fields that were not present in the schema. The message is probably being interpreted as a B message with a few unknown fields.

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to prot...@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

SAMEER CHAUDHARI

unread,
Nov 28, 2016, 11:41:38 AM11/28/16
to Adam Cozzette, Protocol Buffers
Yes

On Mon, Nov 28, 2016, 11:25 AM Adam Cozzette <acoz...@google.com> wrote:
Just to make sure I understand, are you saying you are taking a serialized message of some type A and attempting to parse it as a different type B and you are wondering why it is succeeding despite the mismatch? If so, the answer is that protocol buffers are designed to allow schemas to evolve over time and so it is typical and expected to come across fields that were not present in the schema. The message is probably being interpreted as a B message with a few unknown fields.
On Thu, Nov 24, 2016 at 7:15 AM, SAMEER CHAUDHARI <sameer.m....@gmail.com> wrote:
Hi ,

Language :=>           C++
Proto Compiler :=>   2.6.1
API :=>                   ParseFromArray

Why does parseFromArray is not failing when passed with valid different  ProtoBuff message ?




--
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.
Reply all
Reply to author
Forward
0 new messages