swagger-api / swagger-api/swagger-codegen

[JAVA] [3.0.14] swagger-codegen erroneously encodes = chars in Headers

Open
#9,835 2 comments 1 reaction 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

Source Swagger
"produces": ["application/json; charset=utf-8"],

Java/Feign Output

  @Headers({
      "Content-Type: application/json; charset=utf-8"
  })

The above behaviour is not desirable. The downstream service (a javascript service) did not decode the = chars in the headers and failed to produce a valid response.

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

Reproduce the issue from the shown Swagger produces value and inspect the generated Java/Feign header output. Trace where the equals sign becomes an encoded entity in the code-generation path or template, then verify that generated headers preserve the literal equals sign and produce a valid downstream response.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.