fix: preserve default values in x-goog-request-params #1250
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.
Note that this PR is against
update-showcase-baseline
branch, which, when merged, will make it green since the updated Showcase Compliance will now produce a valid library.The three changes in this PR across all the baseline tests are:
In the generated client, in the place where we build
x-goog-request-params
header, use??
instead of||
. The difference is small: if a value is0
, it's still defined, so should not be overridden by''
. It suddenly becomes important whenx-goog-request-params
contains values that are not strings.In tests, again, because some values to be placed in
x-goog-request-params
are not strings incompliance.proto
, the whole idea of type-appropriate default value (to fill the fake request) appears, using someprotobuf.js
reflection type magic.The new
echo.proto
shows how complicated the routing header settings could be, so I needed to simplify the generated unit tests to make it still check the logic but not becoming the change detector test.