gapic-generator-python icon indicating copy to clipboard operation
gapic-generator-python copied to clipboard

Improve comments for google.protobuf.empty

Open parthea opened this issue 1 month ago • 1 comments

The request message for GetAccountForGcpRegistration in google/shopping/merchant/accounts/v1/developerregistration.proto here has google.protobuf.Empty as a request message.

  // Retrieves the merchant account that the calling GCP is registered with.
  rpc GetAccountForGcpRegistration(google.protobuf.Empty)
      returns (GetAccountForGcpRegistrationResponse) {
    option (google.api.http) = {
      get: "/accounts/v1/accounts:getAccountForGcpRegistration"
    };
  }

When this happens, the generated code looks like this

            request (Optional[Union[google.protobuf.empty_pb2.Empty, dict]]):
                The request object. A generic empty message that you can
                re-use to avoid defining duplicated
                empty messages in your APIs. A typical
                example is to use it as the request or
                the response type of an API method. For
                instance:

                    service Foo {
                      rpc Bar(google.protobuf.Empty)
                returns (google.protobuf.Empty);     }

Regardless if google.protobuf.Empty is correct as a request message, we should improve the output as it doesn't appear to be helpful for users.

parthea avatar Nov 19 '25 18:11 parthea