OpenAPITools / OpenAPITools/openapi-generator

[REQ][typescript-axios] parameterNaming option

Open
#8,296 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Client: TypeScript Enhancement: Feature
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Is your feature request related to a problem? Please describe.

In using the typescript-axios generator, I found that the default behaviour of using positional paramters for query parameters to be dangerous, as described in #6288 - and so I'm using useSingleRequestParameter=true. This then exposes the paramName (which is normalised to camelCase) to my application. I need the parameter names in original form as described by the openApi spec.

Describe the solution you'd like

An option to change the renaming behaviour of paramName, which works in the same way as enumPropertyNaming or modelPropertyNaming parameters.

Describe alternatives you've considered

Changing the naming in the client application to use the more JS-idiomatic camelCase names.
Changing the api to use camelCase names.
Disabling useSingleRequestParameter - this is the least work but I think it's too dangerous.

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 with the typescript-axios generator and trace how useSingleRequestParameter handles paramName. Compare its option handling with enumPropertyNaming and modelPropertyNaming. Done means a parameterNaming option can preserve the original OpenAPI parameter names or apply the selected naming behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 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.