Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing types #2155

Open
1 of 2 tasks
alumni opened this issue Feb 14, 2025 · 0 comments
Open
1 of 2 tasks

Missing types #2155

alumni opened this issue Feb 14, 2025 · 0 comments
Labels
bug Something isn't working openapi-ts Relevant to the openapi-typescript library

Comments

@alumni
Copy link

alumni commented Feb 14, 2025

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

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

Extra

@alumni alumni added bug Something isn't working openapi-ts Relevant to the openapi-typescript library labels Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working openapi-ts Relevant to the openapi-typescript library
Projects
None yet
Development

No branches or pull requests

1 participant