Skip to content

fix(generation): let httpx choose the multipart boundary (backport #542 to stable/10) - #543

Merged
jwulf merged 1 commit into
stable/10from
backport-542-to-stable/10
Dec 1, 2026
Merged

jwulf merged 1 commit into
stable/10from
backport-542-to-stable/10

Conversation

@camunda-sdk-automation

Copy link
Copy Markdown
Contributor

Backport of #542 to stable/10.

Generated code is restored from stable/10 and regenerated by the Backport workflow in a separate chore(gen) commit.

relates to #541 openapi-generators/openapi-python-client#1511 #390

* 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)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

@jwulf

jwulf commented Dec 1, 2026

Copy link
Copy Markdown
Member

🤖 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.

@jwulf

jwulf commented Dec 1, 2026

Copy link
Copy Markdown
Member

nano-ack: issuecomment-7316980672 — Noted: this is the agent attribution notice, not a change request. No code change needed.

@jwulf
jwulf merged commit 5adf2ac into stable/10 Dec 1, 2026
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants