Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix multipart body file array #938

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

micha91
Copy link

@micha91 micha91 commented Jan 13, 2024

As described in #692 arrays of files are not handled correctly, if they are part of multipart/form-data. This is fixed in this PR by letting to_multipart return a List[Tuple[str, Any]] instead of a Dict[str, Any].

@micha91 micha91 force-pushed the fix-multipart-body-file-array branch from 651fddc to fe841d7 Compare January 13, 2024 10:52
@micha91 micha91 changed the title Fix multipart body file array fix: Fix multipart body file array Jan 13, 2024
@dbanty dbanty added the 🥚breaking This change breaks compatibility label Jan 15, 2024
@dbanty
Copy link
Collaborator

dbanty commented Jan 15, 2024

Thanks for adding this support! I believe this is a breaking change, since it's possible someone was using the JSON serialization behavior before (even though it seems wrong in general). I'll need to do some manual testing just to make sure I know how to describe the breaking change 😅. I'd also love to get someone to test a real running API and verify it all functions (maybe you've already done this?)

@micha91
Copy link
Author

micha91 commented Jan 15, 2024

Yes, I already use the updated model template as a custom template in a project. Unfortunately this project is not public yet and the API it is developed for, isn't publicly accessible, too

@ratgen
Copy link

ratgen commented Feb 15, 2024

Hi, just tested this out with an api I am working on. It works great.

dbanty and others added 4 commits February 22, 2024 10:58
# Conflicts:
#	end_to_end_tests/golden-record/my_test_api_client/models/model_with_additional_properties_refed.py
#	end_to_end_tests/golden-record/my_test_api_client/models/model_with_any_json_properties.py
#	end_to_end_tests/golden-record/my_test_api_client/models/model_with_circular_ref_in_additional_properties_a.py
#	end_to_end_tests/golden-record/my_test_api_client/models/model_with_circular_ref_in_additional_properties_b.py
#	end_to_end_tests/golden-record/my_test_api_client/models/model_with_primitive_additional_properties_a_date_holder.py
#	end_to_end_tests/golden-record/my_test_api_client/models/model_with_recursive_ref_in_additional_properties.py
#	openapi_python_client/templates/model.py.jinja
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🥚breaking This change breaks compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants