Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

Commit 3768635

Browse files
committed
fix(rest): Use strict encoding to lowercase query string bools
- depend on google-api-core >= 2.10.0 for REST transport - use `strict` to force query string booleans to be JSON encoded in lower case
1 parent 0bf4485 commit 3768635

4 files changed

Lines changed: 3 additions & 8 deletions

File tree

gapic/ads-templates/%namespace/%name/%version/%sub/services/%service/transports/rest.py.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ class {{service.name}}RestTransport({{service.name}}Transport):
364364
"{host}{uri}".format(host=self._host, uri=uri),
365365
timeout=timeout,
366366
headers=headers,
367-
params=rest_helpers.flatten_query_params(query_params),
367+
params=rest_helpers.flatten_query_params(query_params, strict=True),
368368
{% if body_spec %}
369369
data=body,
370370
{% endif %}

gapic/ads-templates/setup.py.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ setuptools.setup(
1919
install_requires=(
2020
{# TODO(dovs): remove when 1.x deprecation is complete #}
2121
{% if 'rest' in opts.transport %}
22-
'google-api-core[grpc] >= 2.4.0, < 3.0.0dev',
22+
'google-api-core[grpc] >= 2.10.0, < 3.0.0dev',
2323
{% else %}
2424
'google-api-core[grpc] >= 1.28.0, < 3.0.0dev',
2525
{% endif %}

gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/rest.py.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ class {{service.name}}RestTransport({{service.name}}Transport):
398398
"{host}{uri}".format(host=self._host, uri=uri),
399399
timeout=timeout,
400400
headers=headers,
401-
params=rest_helpers.flatten_query_params(query_params),
401+
params=rest_helpers.flatten_query_params(query_params, strict=True),
402402
{% if body_spec %}
403403
data=body,
404404
{% endif %}

gapic/templates/setup.py.j2

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,7 @@ setuptools.setup(
3030
platforms='Posix; MacOS X; Windows',
3131
include_package_data=True,
3232
install_requires=(
33-
{# TODO(dovs): remove when 1.x deprecation is complete #}
34-
{% if 'rest' in opts.transport %}
3533
'google-api-core[grpc] >= 2.10.0, < 3.0.0dev',
36-
{% else %}
37-
'google-api-core[grpc] >= 2.10.0, < 3.0.0dev',
38-
{% endif %}
3934
'libcst >= 0.2.5',
4035
'googleapis-common-protos >= 1.55.0, <2.0.0dev',
4136
'proto-plus >= 1.19.7',

0 commit comments

Comments
 (0)