The Official documentation about map type says:
map<key_type, value_type> map_field = N;
...where the key_type can be any integral or string type (so, any scalar type except for floating point types and bytes). The value_type can be any type.
I want to define a map<string, repeated string>
field, but it seems illegal on my libprotoc 3.0.0
, which complains Expected ">"
. So I wonder if there is any way to put repeated string into map.
A Possible workaround could be:
message ListOfString {
repeated string value = 1;
}
// Then define:
map<string, ListOfString> mapToRepeatedString = 1;
But ListOfString
here looks redundant.