2D array of strings in proto3

Skip to first unread message

Haseeb Bhatti

Jan 2, 2023, 7:31:01 AMJan 2
to Protocol Buffers
Hi everyone!
I am new to proto3 and loopback4. I want to declare a 2D array of strings in proto3 interface message service:  I want the result to be like this: [[""],  [""] , [""] ], Kindly help me to solve this, i have searched everywhere but didn't find support of 2D array in proto3.

Jorg Brown

Jan 16, 2023, 5:24:32 PMJan 16
to Protocol Buffers
Proto has no support for arrays with more than one dimension.  Therefore you'll need to create an array of arrays.  Or in proto terms, a repeated field of a proto message, where that message has a repeated field of strings.


message RowOfStrings {
  repeated string row = 1;

message ArrayOfStrings {
  repeated RowOfStrings col = 1;

-- Jorg

Reply all
Reply to author
0 new messages