Repository navigation
fix(generation): let httpx choose the multipart boundary (backport #542 to stable/9) - #544
Conversation
* test(generation): reproduce truncated multipart uploads from the fixed boundary Refs #541 * fix(generation): let httpx choose the multipart boundary openapi-python-client 0.29 makes every multipart endpoint send Content-Type: multipart/form-data; boundary=+++. httpx encodes the body with that boundary, so an uploaded file containing "\r\n--+++" ended its part early and the rest was parsed as a malformed extra part. This hit create_deployment (and deploy_resources_from_files), create_document and create_documents. Post-gen hook 0420 removes that header line, so httpx sets Content-Type with a random boundary for each request. Upstream made the same change in 0.30 (openapi-generators/openapi-python-client#1511). We can't take 0.30 yet because it moves generated clients to httpx2. Closes #541 * chore(generation): regenerate SDK for the multipart boundary fix (cherry picked from commit 0bea8e3)
There was a problem hiding this comment.
🟡 Changes recommended
The acceptance tests hard-code generated/ instead of locating the imported SDK, so runs using --out-dir can scan stale code or fail despite correct alternate output.
1 open issue
What changed in this PR
Backports #542 to stable/9, fixing multipart upload truncation when file contents contain the generator’s fixed boundary.
Changes:
- Adds a post-generation hook that removes fixed multipart boundary headers, allowing httpx to choose the boundary.
- Adds endpoint-wide boundary checks, payload round-trip tests, and hook transformation tests.
- Regenerates the three affected upload endpoints.
| File | Description |
|---|---|
tests/acceptance/test_multipart_boundary.py |
Adds multipart boundary regression coverage and hook tests. |
hooks/post_gen/0420_drop_fixed_multipart_boundary.py |
Removes fixed multipart boundary headers during generation. |
generated/camunda_orchestration_sdk/api/resource/create_deployment.py |
Delegates deployment upload boundary selection to httpx. |
generated/camunda_orchestration_sdk/api/document/create_documents.py |
Delegates batch document upload boundary selection to httpx. |
generated/camunda_orchestration_sdk/api/document/create_document.py |
Delegates single document upload boundary selection to httpx. |
Review effort: Balanced
Signed-off-by: Josh Wulf <josh.wulf@camunda.com>
|
🤖 The changes in this PR were produced by nano-agent, an autonomous agent. Commits are authored under the operator's own git identity when one is resolvable (the human running the fleet), so they can satisfy CLA/DCO requirements; this note records that the work was generated by the agent. |
|
nano-ack: issuecomment-7317021059 Noted. This is the attribution notice for the agent's work, so no code change is needed. Commits stay signed off under the operator's identity. |

Backport of #542 to
stable/9.Generated code is restored from
stable/9and regenerated by the Backport workflow in a separatechore(gen)commit.relates to #541 openapi-generators/openapi-python-client#1511 #390