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
  • #12927
Closed
Open
Issue created Jul 19, 2022 by Administrator@rootContributor5 of 5 checklist items completed5/5 checklist items

[BUG][typescript-fetch] New FetchError class incorrectly extends base class Error

Created by: sevein

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?
Description

https://github.com/OpenAPITools/openapi-generator/commit/3a2bbbb8501f7238dba0dc124234e9e0459cdd9e introduced a new class (FetchError) that produces a build issue in TypeScript when using the strict mode:

src/openapi-generator/runtime.ts:239:14 - error TS2415: Class 'FetchError' incorrectly extends base class 'Error'.
  Types of property 'cause' are incompatible.
    Type 'unknown' is not assignable to type 'Error | undefined'.

239 export class FetchError extends Error {
                 ~~~~~~~~~~

Example of FetchError:

https://github.com/OpenAPITools/openapi-generator/blob/8d62e597ae6cd463b5c203a9662643dc839bfec0/samples/client/petstore/typescript-fetch/builds/with-interfaces/runtime.ts#L239-L244

openapi-generator version

v6.0.1 (and master)

OpenAPI declaration file content or url

N/A

Generation Details

N/A

Steps to reproduce

N/A

Related issues/PRs

FetchError was introduced in the context of this issue: https://github.com/OpenAPITools/openapi-generator/pull/12716.

Suggest a fix

N/A

Assignee
Assign to
Time tracking