OpenAPITools / OpenAPITools/openapi-generator

[REQ][Java] Use aggregate parameter objects as function arguments for api

Open
#7,753 1 comment 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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.

We would need the possibility to use aggregate parameter objects as function arguments for API, similar to other generators, i.e. typescript.

We have a lot of APIs that have many optional parameters and when a new parameter is added then all the client calls need to be modified by adding the new parameter with a null value.

Describe the solution you'd like

The solution would be to specify a boolean config option, namely useObjectParameters, that, when set to true, the generated code would use aggregate parameter objects as function arguments for API operations instead of passing each parameter as a separate function argument.

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 comparing the Java generator's API operation argument generation with the TypeScript generator linked in the issue. Trace how generator options are declared and applied, then define how useObjectParameters should affect generated Java API signatures and calls. Done means the option is documented and its generated output is covered by the relevant generator tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, openapi
Domain
api, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.