-
Notifications
You must be signed in to change notification settings - Fork 373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(generator): handle explicit routing params for nested fields #9408
fix(generator): handle explicit routing params for nested fields #9408
Conversation
Google Cloud Build Logs
ℹ️ NOTE: Kokoro logs are linked from "Details" below. |
Codecov Report
@@ Coverage Diff @@
## main #9408 +/- ##
=======================================
Coverage 94.60% 94.61%
=======================================
Files 1485 1485
Lines 136008 136054 +46
=======================================
+ Hits 128669 128721 +52
+ Misses 7339 7333 -6
Continue to review full report at Codecov.
|
Google Cloud Build Logs
ℹ️ NOTE: Kokoro logs are linked from "Details" below. |
Google Cloud Build Logs
ℹ️ NOTE: Kokoro logs are linked from "Details" below. |
Part of the work for #9121
Handle fields that look like
field.sub_field
. I re-read the explicit routing parameters spec and they allow for these nested fields.We copy the implementation from the
HttpRule
:google-cloud-cpp/generator/internal/descriptor_utils.cc
Lines 255 to 264 in d67dce6
In order to test this,
IsContextMDValid
needs to learn how to generically access this field name. (It did not need to before because theHttpRule
only checks that a routing key exists and matches some known pattern. It does not set its expectations by looking at the request's contents like theRoutingRule
does.)I added a new test for the nested case. And updated all explicit routing tests to both use
IsContextMDValid
and to verify the expected headers manually. This sorta-kinda testsIsContextMDValid
.This change is