Skip to content

Commit

Permalink
fix: ignore unknown fields returned from server for REST (#777)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
vam-google authored Feb 17, 2021
1 parent 029923f commit a70b078
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,10 @@ class {{ service.name }}RestTransport({{ service.name }}Transport):
{%- if not method.void %}

# Return the response
return {{ method.output.ident }}.from_json(response.content)
return {{ method.output.ident }}.from_json(
response.content,
ignore_unknown_fields=True
)
{%- endif %}
{%- endif %}
{%- endfor %}
Expand Down

0 comments on commit a70b078

Please sign in to comment.