Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #12948
Closed
Open
Issue created Jul 20, 2022 by Administrator@rootContributor5 of 6 checklist items completed5/6 checklist items

[BUG][typescript-fetch] Compile error when using "noImplicitOverride" in tsconfig

Created by: douniii

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

When compiling the generated code with a tsconfig where "noImplicitOverride": true (see here) is set, the compiler complains about the not marked overrides: This member must have an 'override' modifier because it overrides a member in the base class 'Error'.

openapi-generator version

6.0.1 (and master) by using "@openapitools/openapi-generator-cli": "2.5.1"

OpenAPI declaration file content or url

N/A

Generation Details
openapi-generator-cli generate -i ./openapi.json -g typescript-fetch -o src/generated-sources/openapi --additional-properties=supportsES6=true,npmVersion=8.6.0,typescriptThreePlus=true
Steps to reproduce

Checkout https://github.com/OpenAPITools/openapi-generator/tree/master/samples/client/petstore/typescript-fetch/builds/es6-target and add to the tsconfig "noImplicitOverride": true,.

{
  "compilerOptions": {
    "noImplicitOverride": true,
    "declaration": true,
    "target": "es6",
    "module": "commonjs",
    "moduleResolution": "node",
    "outDir": "dist",
    "typeRoots": [
      "node_modules/@types"
    ]
  },
  "exclude": [
    "dist",
    "node_modules"
  ]
}

and build it.

Related issues/PRs
Suggest a fix

Place "override" before overridding props/methods here https://github.com/OpenAPITools/openapi-generator/blob/6d44f97d6cc4bcd11752ca6556075232dc4e5fdb/modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache#L222 https://github.com/OpenAPITools/openapi-generator/blob/6d44f97d6cc4bcd11752ca6556075232dc4e5fdb/modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache#L229 https://github.com/OpenAPITools/openapi-generator/blob/6d44f97d6cc4bcd11752ca6556075232dc4e5fdb/modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache#L230 https://github.com/OpenAPITools/openapi-generator/blob/6d44f97d6cc4bcd11752ca6556075232dc4e5fdb/modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache#L236

Assignee
Assign to
Time tracking