-
Notifications
You must be signed in to change notification settings - Fork 79
Closed
Labels
priority: 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
See the following failure for the generated client google-shopping-merchant-accounts
2026-01-16T21:56:55.2345227Z .nox/mypy-3-14/lib/python3.14/site-packages/google/shopping/merchant_accounts_v1/services/developer_registration_service/transports/rest.py:461: error: "type[Empty]" has no attribute "to_json" [attr-defined]
Specifically the code here
try:
request_payload = type(request).to_json(request)
except:
request_payload = None
In this case the request is google.protobuf.empty_pb2.Empty and does not have a to_json method
As per the following template, the method.output.ident.is_proto_plus_type method is unexpectedly returning True for google.protobuf.empty_pb2.Empty
Line 273 in ae0a9e8
| response_payload = {% if method.output.ident.is_proto_plus_type %}{{ method.output.ident }}.to_json(response){% else %}json_format.MessageToJson(resp){% endif %} |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
priority: 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.