Skip to content

[BUG][TypeScript] Angular Client results in TS4115 missing override #20732

@BjarneRentz

Description

@BjarneRentz

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

The last change introduced a new BaseService that gets inherited. The derived services do not override the constructor parameters as seen in the error message:

 error TS4115: This parameter property must have an 'override' modifier because it overrides a member in base class 'BaseService'.

    34     constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration)

openapi-generator version

We used the latest docker image

OpenAPI declaration file content or url
openapi: 3.0.0
info:
  title: OpenAPI Petstore
  description: This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. For OAuth2 flow, you may use `user` as both username and password when asked to login.
  license:
    name: Apache-2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  version: 1.0.0
externalDocs:
  description: Find out more about OpenAPI generator
  url: https://openapi-generator.tech
tags:
- name: pet
  description: Everything about your Pets
- name: store
  description: Access to Petstore orders
- name: user
  description: Operations about user
paths:
  /pet:
    get:
      tags:
      - pet
      summary: Get a Pet
      operationId: getPet
      responses:
        404:
          description: Pet not found
        405:
          description: Validation exception
Generation Details

docker run openapitools/openapi-generator-cli:latest generate -i openapi.yaml -g typescript-angular with the project related volume bindings

Steps to reproduce
  1. Generate a client for angular in typescript
  2. Try to compile the project
Related issues/PRs

#20681

Suggest a fix

I did not look into all the details but probably adding the missing override attribute in the template will fix this.

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