Repository navigation
fix(generation): let httpx choose the multipart boundary (backport #542 to stable/10) - #543
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.
🟢 Approval recommended
No active review issues are recorded for the backport that lets httpx choose multipart boundaries to avoid upload truncation.
No open issues 🎉
What changed in this PR
Backports #542 to stable/10, preventing uploaded files containing the old fixed multipart boundary from being truncated. The generated SDK now lets httpx choose the boundary for each request.
Changes:
- Adds a post-generation hook that removes fixed multipart boundary headers.
- Regenerates the deployment and document upload endpoints.
- Adds regression tests for boundary removal, payload round-trips, and hook matching behavior.
| File | Description |
|---|---|
tests/acceptance/test_multipart_boundary.py |
Tests multipart endpoint coverage, payload preservation, and hook behavior. |
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 |
Lets httpx choose the deployment upload boundary. |
generated/camunda_orchestration_sdk/api/document/create_documents.py |
Lets httpx choose the multiple-document upload boundary. |
generated/camunda_orchestration_sdk/api/document/create_document.py |
Lets httpx choose the single-document upload boundary. |
Review effort: Balanced
|
🤖 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-7316980672 — Noted: this is the agent attribution notice, not a change request. No code change needed. |
Backport of #542 to
stable/10.Generated code is restored from
stable/10and regenerated by the Backport workflow in a separatechore(gen)commit.relates to #541 openapi-generators/openapi-python-client#1511 #390