OpenAPITools / OpenAPITools/openapi-generator

[BUG] [Typescript-Angular] Regression basePath property is ignored

Open
#21,438 1 comment 2 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

Description

I run the generator through the maven plugin with the following settings:

<configuration>
    <inputSpec>${project.build.directory}/openapi/api.yaml</inputSpec>
    <generatorName>typescript-angular</generatorName>
    <output>${project.basedir}/generated-sources</output>
    <configOptions>
        <fileNaming>kebab-case</fileNaming>
        <ngVersion>19.0.0</ngVersion>
        <npmName>***redacted***</npmName>
        <npmVersion>19.0.0</npmVersion>
        <npmRepository>*****redacted***
        </npmRepository>
        <snapshot>true</snapshot>
    </configOptions>
    <additionalProperties>basePath=</additionalProperties>
</configuration>

openapi-generator version

Up to version 7.12.0 this sets the basePath in the generated code to an empty string. As of 7.13 this seems to be ignored and the basePath is set to http://localhost.

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-angular generator's basePath and additionalProperties handling, using the Maven plugin configuration in the report as the reproduction entry point. Compare generated output from versions 7.12.0 and 7.13; the work is done when basePath= again produces an empty base path rather than http://localhost.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.