Bug Report: Missing Closing Parenthesis in Generated Multipart Form Data Code
Summary
The openapi-python-client generator produces invalid Python syntax when generating multipart form data handling code, specifically missing closing parentheses in files.append() calls within the to_multipart() method.
When generating code for the AssetMediaCreateDto model, the generator produces malformed Python code in the to_multipart() method. Specifically, line 180 in the generated file is missing a closing parenthesis:
The missing parenthesis causes a cascade of syntax errors:
SyntaxError: Expected 'else', found ':'
SyntaxError: Unparenthesized generator expression cannot be used here
SyntaxError: Expected ',', found ':'
SyntaxError: Expected ')', found newline
Check the generated file: immich_client/models/asset_media_create_dto.py
Look at line 180 in the to_multipart() method
Expected Behavior
The generator should produce valid Python syntax with properly closed parentheses.
Actual Behavior
The generator produces invalid Python syntax with missing closing parentheses, causing the generated code to fail linting and runtime checks.
Impact
Generated code cannot be used without manual fixes
Breaks automated CI/CD pipelines that rely on generated code
Requires manual intervention after each code generation
Workaround
Currently, the issue must be manually fixed by adding the missing closing parenthesis to the affected line.
Additional Information
This appears to be a template rendering issue in the multipart form data generation logic. The bug is reproducible and occurs consistently in the same location.
Activity
nicotsx commented on Sep 26, 2025
Experiencing the same. Going back to 0.24.3 resolves the issue
Fix bad code generation (#1360)
dbanty commented on Dec 3, 2025
Fixed by #1360
Release 0.28.0 (#1368)