swagger-api / swagger-api/swagger-codegen

Don't change param names when generating Feign interfaces

Open
#5,810 5 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

At the moment param names are changed from snake_case to camelCase when generating Feign interfaces.

So when generating client code for this spec:

parameters: [
    {
        name: "grant_type",
        in: "formData",
        description: "client_credentials",
        required: true,
        type: "string",
        default: "client_credentials"
    }
]

your body ends up like this:

{
grandtType: "XXXX"
}
when it actually should look like this:

{
grant_type: "XXXX"
}

Swagger-codegen version

2.2.2

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 locating the Feign interface generator and the parameter-name conversion used for formData parameters. Reproduce the provided specification and verify that the generated request body preserves grant_type instead of changing it to camelCase; add or update the relevant generator coverage if one is found.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
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.