feat(generator): delegate REST transcoding to google-api-core#17766
Open
hebaalazzeh wants to merge 2 commits into
Open
feat(generator): delegate REST transcoding to google-api-core#17766hebaalazzeh wants to merge 2 commits into
hebaalazzeh wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors REST transcoding in the GAPIC generator by centralizing the transcoding logic into a new transcode function within google-api-core (gapic_v1.rest_transcoding). This change eliminates redundant static helper methods (_get_transcoded_request, _get_request_body_json, and _get_query_params_json) from the generated transport templates. Additionally, the PR updates test configurations and introduces comprehensive unit tests for the new transcoding utility. The feedback suggests optimizing the transcode function by using json_format.MessageToDict directly instead of the inefficient round-trip serialization of json.loads(json_format.MessageToJson(...)).
hebaalazzeh
force-pushed
the
feat/gapic-generator-centralization-transcoding
branch
3 times, most recently
from
July 18, 2026 06:02
b9bb9f0 to
a8a1968
Compare
hebaalazzeh
force-pushed
the
feat/gapic-generator-centralization-transcoding
branch
from
July 21, 2026 16:31
203e87a to
5e89b3d
Compare
hebaalazzeh
marked this pull request as ready for review
July 21, 2026 22:36
hebaalazzeh
force-pushed
the
feat/gapic-generator-centralization-transcoding
branch
from
July 21, 2026 23:12
909a6fe to
dfca3e0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
this PR refactors generator templates to delegate REST transcoding to the centralized helper in
google-api-core.Scope of Changes:
_shared_macros.j2: Replaced inline static helper invocation withgapic_v1.rest_transcoding.transcode().rest_base.py.j2: Stripped the redundant_get_transcoded_request,_get_request_body_json, and_get_query_params_jsonhelper functions._rest_mixins_base.py.j2: Stripped the redundant static helpers from API REST mixins base.rest.py.j2&rest_asyncio.py.j2: Passed the configuration flags (likeopts.rest_numeric_enums) into the transcoding macro.noxfile.py: Configured localpackages/google-api-coreto be installed during virtualenv test generation so the new transcoding runtime module is available.related PR: #17765