Tomas Kislan
unread,Jun 3, 2012, 2:56:32 AM6/3/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Protocol Buffers
Hello,
i have little problem with "dynamic" messages
as i want to send with required message_type, and according to that
type i want to send different nested message along it
example:
message Message {
required int64 type = 1;
optional NestedMessage = 20;
optional AnotherNestedMessage = 21;
}
now those nested messages have some required fields, but themselves
are optional in message
so lets say if type == 1 i want to send NestedMessage, if type == 2
AnotherNestedMessage
but if i dont fill both messages, i get protobuf fatalexception that
the fields from the nested message, i dont want to use atm, are
missing
and thats kinda unwanted behaviour for me and i ask:
is there a possible solution how to overcome this?
or another way how to do different types of nested messages?
Thank you