-
Notifications
You must be signed in to change notification settings - Fork 77
Labels
🚨This issue needs some love.This issue needs some love.generatorBugs, features, and so forth pertaining to the generated client surfaceBugs, features, and so forth pertaining to the generated client surfacepriority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
Minimal reproducible code:
service MyService {
rpc MyMethod(MethodRequest) returns (MethodResponse) {
option (google.api.method_signature) = "inputs,parameters";
}
}
message MethodRequest {
repeated google.protobuf.Value inputs = 1;
}
message MethodResponse {
google.protobuf.Value output = 1;
}In the portion of the client method that constructs the request, the following lines occur
if inputs is not None:
request.inputs = inputsThis causes protobuf to raise an error because request.intputs is a repeated field.
The solution is to do the following instead:
if inputs is not None:
request.inputs.extend(inputs)Metadata
Metadata
Assignees
Labels
🚨This issue needs some love.This issue needs some love.generatorBugs, features, and so forth pertaining to the generated client surfaceBugs, features, and so forth pertaining to the generated client surfacepriority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.