carvalhorr / protoc-gen-mock

47 stars 11 forks source link

Not allow to add stub with more than one of the fields in a oneof set #34

Open carvalhorr opened 4 years ago

carvalhorr commented 4 years ago

ex.:

service Greeter {
    rpc Hello(Request) returns (Response) {}
}

message Request {
    string name = 1;
    repeated Request req = 2;
    oneof optional {
        string option1 = 3;
        string option2 = 4;
    }
}

message Response {
    string greeting = 1;
}

It is allowing to add a stub with both option1 and option2 set.

EXPECTED: It should return a validation error when adding a stub with both fields set.