File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed
src/openapi_python_generator/language_converters/python/templates Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ with httpx.Client(base_url=base_path) as client:
3838 raise HTTPException(response.status_code, f'{{ operationId }} failed with status code: {response.status_code}')
3939{% if return_type .complex_type %}
4040{% if return_type .list_type is none %}
41- return {{ return_type.type.converted_type }}(**response.json())
41+ return {{ return_type.type.converted_type }}(**response.json()) if response.json() is not None else {{ return_type.type.converted_type }}()
4242{% else %}
4343 return [{{ return_type.list_type }}(**item) for item in response.json()]
4444{% endif %}
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ def {{ operation_id }}({{ params }}) -> {% if return_type.type is none or return
3131 raise HTTPException(response.status_code, f'{{ operationId }} failed with status code: {response.status_code}')
3232{% if return_type .complex_type %}
3333{% if return_type .list_type is none %}
34- return {{ return_type.type.converted_type }}(**response.json())
34+ return {{ return_type.type.converted_type }}(**response.json()) if response.json() is not None else {{ return_type.type.converted_type }}()
3535{% else %}
3636 return [{{ return_type.list_type }}(**item) for item in response.json()]
3737{% endif %}
You can’t perform that action at this time.
0 commit comments