Skip to content

Commit dc8e1ae

Browse files
Merge pull request #22 from MarcoMuellner/16-payload-in-certain-routes-is-not-actually-sent-to-the-api
:fix: Added body to aiohttp object
2 parents 10c73b4 + 43527b0 commit dc8e1ae

File tree

1 file changed

+7
-0
lines changed
  • src/openapi_python_generator/language_converters/python/templates

1 file changed

+7
-0
lines changed

src/openapi_python_generator/language_converters/python/templates/aiohttp.jinja2

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ async def {{ operation_id }}({{ params }}) -> {% if return_type.type is none or
2121
'{{ method }}',
2222
base_path + path,
2323
params=query_params,
24+
{% if body_param %}
25+
{% if use_orjson %}
26+
data=orjson.dumps({{ body_param }})
27+
{% else %}
28+
json = {{ body_param }}
29+
{% endif %}
30+
{% endif %}
2431
) as inital_response:
2532
if inital_response.status != {{ return_type.status_code }}:
2633
raise HTTPException(inital_response.status, f'{{ operationId }} failed with status code: {inital_response.status}')

0 commit comments

Comments
 (0)