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

[BUG] [TypeScript] Generated TypeScript dependency version conflict when generated module nested in another project #2394

Closed
3 of 5 tasks
karlvr opened this issue Mar 14, 2019 · 1 comment

Comments

@karlvr
Copy link
Contributor

karlvr commented Mar 14, 2019

Bug Report Checklist

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

TypeScript looks in parent folders for node_modules/@types folders from which to load type definitions. If you nest the openapi generated TypeScript module in subfolder of a folder containing a node_modules which depends upon a later version of TypeScript, then when building the generated module, TypeScript finds the other node_modules/@types, tries to load them and fails.

openapi-generator version

HEAD (4.0.0). It is not a regression.

Steps to reproduce
npm init -y
npm install -D @types/jest
mkdir gen
openapi-generator generate -i http://petstore.swagger.io/v2/swagger.json -g typescript-fetch -o gen
cd gen
tsc

The tsc command fails due to the types that it doesn't understand.

Related issues/PRs

I am about to push a PR.

@auto-labeler
Copy link

auto-labeler bot commented Mar 14, 2019

👍 Thanks for opening this issue!
🏷 I have applied any labels matching special text in your issue.

The team will review the labels and make any necessary changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant