Skip to content

Commit

Permalink
fix: cater for empty async call (#1997)
Browse files Browse the repository at this point in the history
  • Loading branch information
parthea committed Mar 22, 2024
1 parent 2307345 commit 801eedb
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -325,10 +325,8 @@ class {{ service.async_client_name }}:
# so it must be constructed via keyword expansion.
if isinstance(request, dict):
request = {{ method.input.ident }}(**request)
{% if method.flattened_fields %}{# Cross-package req and flattened fields #}
elif not request:
request = {{ method.input.ident }}({% if method.input.ident.package != method.ident.package %}{% for f in method.flattened_fields.values() %}{{ f.name }}={{ f.name }}, {% endfor %}{% endif %})
{% endif %}{# Cross-package req and flattened fields #}
request = {{ method.input.ident }}({% if method.flattened_fields %}{% for f in method.flattened_fields.values() %}{{ f.name }}={{ f.name }}{% if not loop.last %}, {% endif %}{% endfor %}{% endif %})
{% else %}
request = {{ method.input.ident }}(request)
{% endif %} {# different request package #}
Expand Down

0 comments on commit 801eedb

Please sign in to comment.