-
Notifications
You must be signed in to change notification settings - Fork 129
Generate method overloads when a resource field has multiple resource names configured #3081
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3081 +/- ##
=========================================
Coverage 87.03% 87.03%
Complexity 6000 6000
=========================================
Files 493 493
Lines 23869 23869
Branches 2584 2584
=========================================
Hits 20775 20775
Misses 2239 2239
Partials 855 855 Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM from the generated code point of view. Just one question.
.setRequiredSingularResourceName(requiredSingularResourceName) | ||
.setRequiredSingularResourceNameOneof(requiredSingularResourceNameOneof) | ||
.setRequiredSingularResourceNameCommon(requiredSingularResourceNameCommon) | ||
.setRequiredSingularResourceName(requiredSingularResourceName == null ? null : requiredSingularResourceName.toString()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it correct that a required resource-name is allowed to be null
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been how java delegates the overload with resource name to the non-flattened method.
Actually I think protobuf Java does not allow setting null values on any field, so the code will still fail on the client side. I guess we just pass the error handling to protobuf :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (based on our in-person conversation)
child_type
reference and the referenced resource has multiple patterns, allow this field to be associated with multiple resources if all these resources combined have exactly all the parent patterns of the resource referenced bychild_type
.List<String>
to avoid multiple methods having the same signature after type erasure.*
annotation is not yet supported.See changes to
ArchiveBooks
,LongRunningArchiveBooks
andStreamingArchiveBooks
for testing generating overloads for unary, longrunning and streaming methods.See changes to
MoveBooks
for testing generating all the combinations.