lua-pb icon indicating copy to clipboard operation
lua-pb copied to clipboard

getting error while using "oneof" & "map" tag in proto file

Open onlynishant opened this issue 8 years ago • 0 comments

I am using "oneof" tag in my proto file but getting error while using it.

Msg.proto

// THIS DOESN'T WORK
message Msg1 {
  required string id = 1;
  repeated string name = 2;
  // Use either of them
  oneof login_oneof {
    string email = 3;
    string username = 4;
 }
map<int32, string> maps = 3;
}

// THIS WORKS
message Msg2 {
  required string id = 1;
  repeated string name = 2;
  optional string email = 3;
  optional string username = 4;
}

Error: lua entry thread aborted: runtime error: Lexical error in line 6, near "p = 2;\n\n o": expected '}'

onlynishant avatar Nov 30 '17 10:11 onlynishant