Skip to content

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

@kzander91

Description

@kzander91

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions