openapi-typescript icon indicating copy to clipboard operation
openapi-typescript copied to clipboard

Missing types

Open alumni opened this issue 9 months ago • 1 comments

openapi-typescript version

7.6.1

Node.js version

20.18.3

OS + version

any

Description

When importing openapi-typescript from a CommonJS project, TypeScript cannot find its types (because the library ships only with types for ESM, not generic for both module systems).

Reproduction

  1. Create a CommonJS TypeScript project (no "type": "module" in package.json and "module": "node16" in tsconfig.json).
  2. import openapi-typescript in any TypeScript file.

Currently, TSC cannot find the library types.

Expected result

TypeScript would not complain about the import and would detect the types correctly.

Required

  • [x] My OpenAPI schema is valid and passes the Redocly validator (npx @redocly/cli@latest lint)

Extra

alumni avatar Feb 14 '25 09:02 alumni