Skip to content

[BUG] [TS] typescript-axios: Ambient declaration custom.d.ts not included in build #4227

Description

@alavkx

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • What's the version of OpenAPI Generator used?
    4.1.3
  • Have you search for related issues/PRs?
  • What's the actual output vs expected output?

Expected: Consumed in typescript with no build errors
Actual:
package_json__Working_Tree__—_flow-builder-backend

Description

Generates typescript files (api.ts, etc) with a relative ref to a custom.d.ts file. tsc ignores declaration files—when the compiled output is moved to dist, the custom.d.ts does not come along for the ride and the relative references now point to src/custom.d.ts. This is problematic when the code is distributed to npm and used in another typescript file.

openapi-generator version

4.1.3

Command line used for generation

openapi-generator generate -i dist/spec.json -o src/gen_client -g typescript-axios

Steps to reproduce
  1. Generate new project with openapi-generator generate -i dist/spec.json -o src/gen_client -g typescript-axios
Suggest a fix

Generate a custom.ts instead of a custom.d.ts
Upgrade node and/or @types/node and get ride of the custom.d.ts file altogether

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions