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
  • #2394
Closed
Open
Issue created Mar 14, 2019 by Administrator@rootContributor3 of 5 checklist items completed3/5 checklist items

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

Created by: karlvr

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.

Assignee
Assign to
Time tracking