Status: New
Owner: liuj...@google.com
Labels: Type-Defect Priority-Medium

New issue 304 by taoha...@gmail.com: How to write a parent type in a protobuf message.
http://code.google.com/p/protobuf/issues/detail?id=304

What steps will reproduce the problem?
1.All the message in the .proto file is concrete. However, I really want to define a parent data type which all the child type extends.

What is the expected output? What do you see instead?
I want a versatile message. So...

message NetMessage {
  requried int32 id = 1;
  requried string sessionID = 2;
  required Parent data = 3;
}

message Parent {
}

message Child1 extends Parent {
  optional int32 id = 1;
  optional string name = 2;
}

message Child2 extends Parent {
  optional int32 id = 1;
  optional string filename = 2;
}

May be a alternate solution could solve this problem but...How to deal with it.

Thank you in advance!

What version of the product are you using? On what operating system?
java-2.4.1  windows7

Please provide any additional information below.


--
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 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.

Reply via email to