Reputation: 3308
In protocol buffers is there a way to have a message with collection of nested messages? For example a message Supervisor might have a collection of Employees along with the name and department of the supervisor.
Upvotes: 5
Views: 3821
Reputation: 64454
Yes. You use repeated
fields;
message Employee
{
...
}
message Supervisor
{
repeated Employee employees = 1;
}
You can then access the employees
field as a list.
Upvotes: 8