swagger-api / swagger-api/swagger-codegen

[RUBY] multipart body is not generated when the content-type is multipart/form-data

Open
#9,907 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

multipart body is not generated when the content-type is multipart/form-data

Swagger-codegen version

2.4.10

Swagger declaration file content or url

https://apis.voicebase.com/v3/defs/v3-api.yaml

Steps to reproduce

The request below is supposed to be a multi part request, but it was posted as a form body

api_instance = Voicebase::MediaApi.new
api_instance.post_media(media_url: "https://www.voiptroubleshooter.com/open_speech/american/OSR_us_000_0010_8k.wav")

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the generated Ruby Voicebase::MediaApi#post_media entry point and compare its request handling with the multipart/form-data declaration in the linked v3-api.yaml. Reproduce the call shown in the issue and trace the swagger-codegen Ruby templates until the request is sent as multipart/form-data rather than a form body.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, ruby
Domain
api, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.