OpenAPITools / OpenAPITools/openapi-generator

[REQ] don't return Promise object from ApiApiAxiosParamCreator methods

Open
#9,019 0 comments 0 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

Situation

I use typescript-axios generator.

In a generated Client there is a class ApiApiAxiosParamCreator that wraps request parameters into request URL and options. All its methods do not have async calls, but return Promise. There are situations that require the URL of the API request, not the API request. For example, a string may be passed to some library and processed there. In such cases ApiApiAxiosParamCreator could be used and it would be quite convenient if it returned the object itself, not Promise.

Solution

As a solution you could remove Promise statement from ApiApiAxiosParamCreator methods declaration and wrap methods usage into Promise.

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

Locate the typescript-axios generator output for the ApiApiAxiosParamCreator class and inspect how its parameter-creator methods are declared and consumed. Check the generated client templates and existing tests, then verify that the methods return their request parameter objects directly while request callers still receive the expected Promise behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Feature
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.