Skip setting 'Content-Type' on file upload, when multiple bodies are supported
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 65/100
Research direction
Start with openapi_python_client/templates/endpoint_module.py.jinja, especially the content-type handling around lines 48-63 and the existing multipart condition. Verify generated requests for endpoints supporting multiple body types, and consider the work complete when multipart uploads receive a Content-Type boundary without overriding httpx's header handling.
Written by the indexing model from the issue text.
Description
Describe the bug
Form-style submissions to endpoints that support multiple different content types are missing the necessary "boundary" attribute on the Content-Type header.
POST https://.../items HTTP/1.1
Host: ...
Accept: */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
User-Agent: python-httpx/0.25.2
Authorization: Bearer ...
Content-Type: multipart/form-data
Transfer-Encoding: chunked
In the template above, lines 60-62 have an "if content-type is not multipart/form-data" condition since httpx sets content type and multipart form boundary properly when files are provided. The same condition needs to be applied around line 54, which occurs when multiple body types are supported.
- Dominant language
- Python
- Stars
- 2k
- Forks
- 293
- Avg merge
- 34m
- Merged PRs (30d)
- 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from openapi-generators/openapi-python-client
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
openapi-generators/openapi-python-client#1451 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 52/100
-
Difficulty 3/5 1-2 days Newbie friendliness 64/100
openapi-generators/openapi-python-client#1435 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
All issues in openapi-generators/openapi-python-client
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100