这是indexloc提供的服务,不要输入任何密码
Skip to content

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

@onlynishant

Description

@onlynishant

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 '}'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions