-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
In case that message field (top level one) is specified as repeated and added as field in option (google.api.method_signature) then generated RPC call method argument is T (instead of Iterable or vararg) and it's set in the builder of the message as set* method (which have for collections 2 arguments - index & single item) instead of addAll* method.
Example:
message L1Message1{
string field = 1;
repeated string fields = 2;
L2Nested1 nested_message = 3;
message L2Nested1{
string field =1;
L1Message1 message_field =2;
}
message L2Nested2{
string field = 1;
L2Nested1 message_field =2;
}
}
rpc say_hello (L1Message1) returns (L1Message2){
option (google.api.method_signature) = "field";
option (google.api.method_signature) = "fields";
option (google.api.method_signature) = "nested_message";
option (google.api.method_signature) = "field,nested_message";
};Generated code (which of course cannot be compiled):
suspend fun sayHello(fields: String): TestMessages.L1Message2 {
val request = TestMessages.L1Message1.newBuilder()
.setFields(fields)
.build()
return sayHello(request)
}Metadata
Metadata
Assignees
Labels
No labels