swagger-api / swagger-api/swagger-codegen-generators

Duplicate codegenContents when requestBody has multiple content types and one of them is a form

Open
#837 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
299
Forks
439
PR merge metrics
No merged PRs in 30d

Description

Given a resource with multiple content types, the generated code will not compile if one or more of these content types is either application/x-www-form-urlencoded or multipart/form-data.

In the case where the requestBody is identical, the following fix seems to work. When the request bodies are different, you'll hit #441.

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 by reproducing code generation for a resource whose requestBody has multiple content types, including application/x-www-form-urlencoded or multipart/form-data, and inspect how codegenContents is emitted. Compare the generated output when request bodies are identical, then verify that the result compiles; differing request bodies are already tracked in #441.

Written by the indexing model from the issue text.

Assessment

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