Skip to content

fix: align multipart part content types across clients#119

Merged
adamcavendish merged 1 commit into
masterfrom
adamcavendish/align-multipart-encoding
Jun 15, 2026
Merged

fix: align multipart part content types across clients#119
adamcavendish merged 1 commit into
masterfrom
adamcavendish/align-multipart-encoding

Conversation

@adamcavendish

Copy link
Copy Markdown
Collaborator

Summary

Align multipart request construction across all supported generators so every backend preserves explicit encoding.<part>.contentType and applies the same default per-part Content-Type rules.

What changed

  • Add IR metadata for multipart part content types across OpenAPI 3.0, 3.1, and 3.2 lowering.
  • Add a shared multipart planner used by TypeScript fetch, Go HTTP, Python requests/httpx, Java/Kotlin OkHttp, and Rust reqwest/ureq/aioduct.
  • Emit per-part Content-Type headers consistently for binary, text/primitive, and JSON object/array parts.
  • Replace TypeScript FormData multipart bodies with explicit Blob multipart construction so part headers and boundaries are controllable.
  • Keep generated SDK method signatures unchanged.
  • Add and wire multipart-explicit-encoding.yaml across every golden suite, then regenerate affected multipart goldens.

Validation

  • cargo check --lib
  • just golden-check
  • just golden-build-all with a temporary tsc PATH shim calling npx --yes -p typescript tsc because bare tsc is not installed locally

Build coverage from golden-build-all:

  • TypeScript tsc: 68/68 passed
  • TypeScript vp: 5/5 passed
  • Go: 56/56 passed
  • Rust reqwest: 60/60 passed
  • Rust ureq: 60/60 passed
  • Rust aioduct: 60/60 passed
  • Python httpx: 56/56 passed
  • Python requests: 56/56 passed
  • Java: 57/57 passed
  • Kotlin: 57/57 passed

@adamcavendish adamcavendish marked this pull request as ready for review June 15, 2026 05:33
@adamcavendish adamcavendish force-pushed the adamcavendish/align-multipart-encoding branch from 1f54b4c to bc16c6e Compare June 15, 2026 05:43
IR:
- Preserve OpenAPI multipart encoding contentType in request bodies
- Share multipart part planning across generator backends
- Reject non-JSON complex part encodings consistently

Clients:
- Emit per-part Content-Type for TypeScript, Go, Python, OkHttp, and Rust
- Use controllable TypeScript Blob multipart bodies and backend-native part builders
- Keep public SDK method signatures unchanged

Tests:
- Add explicit multipart encoding fixture across all golden suites
- Regenerate multipart goldens with default and explicit part content types
- Verify golden checks and generated-client build checks
@adamcavendish adamcavendish force-pushed the adamcavendish/align-multipart-encoding branch from bc16c6e to 92617cf Compare June 15, 2026 05:54
@adamcavendish adamcavendish merged commit 80c0927 into master Jun 15, 2026
5 checks passed
@adamcavendish adamcavendish deleted the adamcavendish/align-multipart-encoding branch June 15, 2026 05:54
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.

1 participant