Skip to content

fix(typescript-angular): restore basePath override from additional properties - #25558

Open
thekhegay wants to merge 1 commit into
OpenAPITools:masterfrom
thekhegay:fix/ts-angular-basepath-option
Open

thekhegay wants to merge 1 commit into
OpenAPITools:masterfrom
thekhegay:fix/ts-angular-basepath-option

Conversation

@thekhegay

@thekhegay thekhegay commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Since 7.13.0 (#20816) basePath field in api.base.service.ts is rendered from supporting files bundle
DefaultGenerator copies additional properties into that bundle first and then puts server URL as basePath on top, so --additional-properties=basePath= (or <additionalProperties>basePath=</additionalProperties> in maven plugin) is ignored and client always gets server URL from spec
Override worked up to 7.11.0 while field lived in api.service.ts, api templates get additional properties last

Now TypeScriptAngularClientCodegen puts user supplied basePath back in postProcessSupportingFileData, without it bundle stays as is
Fix is kept in angular generator, reordering in DefaultGenerator would change supporting files of every generator that reads basePath

Added testBasePathFromAdditionalProperties next to testBasePath, it generates with basePath set to '' and /api and checks field in api.base.service.ts, it fails on master
Sample configs dont set basePath, regenerated typescript-angular samples have no diff

Fixes #21438

Open #25353 adds postProcessSupportingFileData to same class too, whichever lands second needs to merge both into one override

PR checklist

  • Read the contribution guidelines.
  • Run the following to build the project and update samples:
    ./mvnw clean package || exit
    ./bin/generate-samples.sh ./bin/configs/*.yaml || exit
    ./bin/utils/export_docs_generators.sh || exit
    
    Commit all changed files.
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

@TiFu @taxpon @sebastianhaas @kenisteward @Vrolijkx @macjohnny @topce @akehir @petejohansonxo @amakhrov @davidgamero @mkusaka @joscha @KannaKim


Summary by cubic

Restores the basePath override from additional properties in the typescript-angular generator, which has been ignored since 7.13.0. The generated client now honors a user-supplied basePath instead of always falling back to the server URL from the spec.

  • Adds postProcessSupportingFileData in TypeScriptAngularClientCodegen; the fix is scoped to the angular generator so other generators that read basePath are unaffected.
  • Adds a regression test covering basePath set to '' and /api.

Written for commit ce7f728. Summary will update on new commits.

View guided diff

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

View guided diff | Re-trigger cubic

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant