Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG][typescript-angular] Spec Server URL no longer used as default basePath #20760

Closed
5 of 6 tasks
kzander91 opened this issue Feb 28, 2025 · 1 comment · Fixed by #20816
Closed
5 of 6 tasks

[BUG][typescript-angular] Spec Server URL no longer used as default basePath #20760

kzander91 opened this issue Feb 28, 2025 · 1 comment · Fixed by #20816

Comments

@kzander91
Copy link

kzander91 commented Feb 28, 2025

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

After the refactoring made in #20681, the generated API controller services no longer define basePath on their own, but inherit it from the new BaseService.

Before:

export class DemoService {

    protected basePath = '/my/api/base/path';
    // ...
}

Template:

After:

export class DemoServie extends BaseService {

   // ...
}

export class BaseService {
    protected basePath = '';
    // ...
}

Template (now hard-coded as ''):

openapi-generator version

7.12.0

OpenAPI declaration file content or url
openapi: 3.0.1
info:
  title: demo
  version: "1.0"
servers:
  - url: /my/api/base/path
paths:
  /relative/path:
    get:
      tags:
        - demo
      responses:
        "200":
          description: OK
Generation Details
Steps to reproduce
Related issues/PRs
Suggest a fix
@daniel-sc
Copy link
Contributor

I'll make a PR for this..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants