You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In cases when multiple routing parameters have the same resource ID path segment name,
117
+
thus referencing the same header key, the "last one wins" rule is used to determine
118
+
which value to send. The "last" here is meant in terms of the order in which they're specified in the annotation. If some of the routing parameters with the same resource ID segment
119
+
name have failed to match the field, or if the field was unset, or if the extracted matched value
120
+
is an empty string, these parameters are not considered when determining which value
In this case if in a given request the `billing_project` field is set to an non-empty value,
142
+
its value will be sent with the `project` key because the routing parameter looking at `billing_project` field is specified last. If the `billing_project` field is not set, the `parent` field will be considered, first trying to send a
143
+
project with a subproject specified, and then without. Note that if a given request has a
144
+
`parent` field with a value e.g. `projects/100/subprojects/200/foo`, patterns in both first and second `routing_parameters` will match it, but the second one will "win" since it is specified "last".
145
+
146
+
If all the routing parameters with the same resource ID segment name have failed
147
+
to match the field, the key-value pair corresponding to those routing parameters'
148
+
resource ID path segment name **must not** be sent.
149
+
150
+
If none of the routing parameters matched their respective fields, the routing header
151
+
**must not** be sent.
152
+
153
+
Much like URL parameters, if there is more than one key-value pair to be sent, the `&`
154
+
character is used as the separator.
155
+
156
+
## Implicit Routing Headers (`google.api.http`)
157
+
158
+
**Note:** For an RPC annotated with the [`google.api.routing`][routing] annotation,
159
+
the [`google.api.http`][http] annotation must be ignored for the purpose of adding
160
+
routing headers.
161
+
162
+
If an unary or server-streaming RPC is not annotated with the [`google.api.routing`][routing]
163
+
annotation, code generators **must** look at URI-based variables declared in the
17
164
[`google.api.http`][http] annotation and transcribe these into the
18
165
`x-goog-request-params` header in unary calls. A URI-based variable is a
19
166
variable declared as a key in curly braces in the URI string. For example:
0 commit comments