Skip to content

fix(runtime): honor request body media types#78

Merged
samzong merged 1 commit into
mainfrom
fix/request-body-media-types
Jun 26, 2026
Merged

fix(runtime): honor request body media types#78
samzong merged 1 commit into
mainfrom
fix/request-body-media-types

Conversation

@samzong

@samzong samzong commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

What's changed?

  • Preserve selected OpenAPI request body media types for non-JSON bodies.
  • Send the request body media type as Content-Type for generated command body uploads.
  • Reject JSON-only body builders for non-JSON request bodies and point users to --file.

Why

  • Fixes non-JSON OpenAPI request bodies being sent as application/json.

Verification

  • go test ./pkg/runtime -run 'TestBuild_(FileSendsRequestBodyMediaType|NonJSONRequestBodyRequiresFile)'\n- go test ./internal/codegen/backends/openapi3 -run TestParse_Golden/request-body-non-json\n- make check\n\n### Related\n\n- Fixes bug: preserve and use OpenAPI request body media types #19

Signed-off-by: samzong <samzong.lu@gmail.com>
@samzong samzong merged commit 6f48e92 into main Jun 26, 2026
3 checks passed
@samzong samzong deleted the fix/request-body-media-types branch June 26, 2026 17:09
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.

bug: preserve and use OpenAPI request body media types

1 participant