Skip to content

Commit a70b078

Browse files
authored
fix: ignore unknown fields returned from server for REST (#777)
Otherwise the client may throw an exception if the server is newer than the client (i.e. some of the returned messages have new fields). A tracking bug: #780
1 parent 029923f commit a70b078

File tree

1 file changed

+4
-1
lines changed
  • gapic/templates/%namespace/%name_%version/%sub/services/%service/transports

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,10 @@ class {{ service.name }}RestTransport({{ service.name }}Transport):
207207
{%- if not method.void %}
208208

209209
# Return the response
210-
return {{ method.output.ident }}.from_json(response.content)
210+
return {{ method.output.ident }}.from_json(
211+
response.content,
212+
ignore_unknown_fields=True
213+
)
211214
{%- endif %}
212215
{%- endif %}
213216
{%- endfor %}

0 commit comments

Comments
 (0)