OpenAPITools / OpenAPITools/openapi-generator

[BUG] [typescript-axios] v4.3.1 - configuration block is not used in resulting code when using factory

Open
#7,238 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue: Bug
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

I generated code for typescript/axios.

My code is:

let accountsApi = AccountsApiFactory( { basePath: 'http://localhost:3000/api/v1'});
accountsApi.getAccountAccessRights('84D865BA-DC1D-4FB3-A2F2-7A85362F7D1D');

This code will disregard the provided basePath, but will use BASE_PATH = http://localhost/api/v1 from the generated base.js file.

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 tracing the generated AccountsApiFactory call and the generated base.js file in the typescript/axios output. Check why the supplied basePath is ignored in favor of BASE_PATH. Done means factory-created clients use the provided basePath, with a regression test covering this example.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, typescript
Domain
api, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.