I would like to create a protobuf message which represents an array of objects.
Example
[
{
"firstKey": "firstValue",
"secondKey": "secondValue",
},
{
"firstKey": "firstValue",
"secondKey": "secondValue",
},
...
]
Pseudo code (not a valid syntax)
syntax = "proto3";
message Entry {
string firstKey = 1;
string secondKey = 2;
}
repeated message Response {
...Entry;
}
I cannot find a way to do this. Is it even possible or am I forced to nest it like this?
syntax = "proto3";
message Entry {
string firstKey = 1;
string secondKey = 2;
}
message Response {
repeated Entry data = 2;
}
syntax = "proto3";
message SingleObject {
string name = 1;
int32 age = 2;
}
message ObjectArray {
repeated SingleObject objects = 1;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With