You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
It is possible to generate a model with a missing import leading to invalid python code.
The below to_multipart function is generated in the body for the create_upload_file_uploadfile__post model and references UploadConfig however it is not in scope.
Describe the bug
It is possible to generate a model with a missing import leading to invalid python code.
The below
to_multipart
function is generated in the body for the create_upload_file_uploadfile__post model and referencesUploadConfig
however it is not in scope.The function
to_dict
right above it in the file lazily importsUploadConfig
OpenAPI Spec File
Desktop (please complete the following information):
Additional context
I have been able to fix this locally by modifying the following
openapi-python-client/openapi_python_client/templates/model.py.jinja
Lines 131 to 134 in 73f92ea
Solution is to add the lazy import template that is found in
to_dict
openapi-python-client/openapi_python_client/templates/model.py.jinja
Lines 126 to 128 in 73f92ea
The text was updated successfully, but these errors were encountered: