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


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
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

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

You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to