swagger-api / swagger-api/swagger-codegen

The Angular Compiler requires TypeScript >=3.6.4 and <3.9.0 but 3.5.3 was found instead.

Open
#10,500 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

When generating an angular-typescript library the package.json is created with the devDependency
"typescript": ">=3.4.0 <3.6.0",
This means that angular 9 and above will not compile. I need to manually change the package.json to
"typescript": "3.8.3", for it to work.

Swagger-codegen version

swagger-codegen-cli-3.0.22.jar

Swagger declaration file content or url
Command line used for generation

java -Dmodels -DsupportingFiles
-jar swagger-codegen-cli-3.0.22.jar
generate -i https://localhost:44387/swagger/v1/swagger.json
-l typescript-angular
-o "src/models"
-Dio.swagger.parser.util.RemoteUrl.trustAll=true
-Dio.swagger.v3.parser.util.RemoteUrl.trustAll=true

Steps to reproduce

Have angular 9 or above installed.
Run swagger codegen and generate a typescript-angular library.
cd into the folder that contains the package.json file
Run npm install
Run npm run build

Related issues/PRs
Suggest a fix/enhancement

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the typescript-angular generator output and the package.json produced by the shown swagger-codegen command. Trace which generator template or entry point supplies the TypeScript devDependency, then verify the generated library with npm install and npm run build under Angular 9 or later. Done means the generated dependency range no longer selects an incompatible TypeScript version.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, typescript
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.