Bug Report Checklist
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.