Skip to content

[BUG] [typescript-angular] dependency conflict in generated package.json for angular v20 #21692

@jschlicker

Description

@jschlicker

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

The typescript-angular generator does not generate a package.json with compatible dependencies. There are dependency conflicts. The following output is written:

npm error Found: @angular/[email protected]
npm error node_modules/@angular/compiler-cli
npm error   dev @angular/compiler-cli@"^20.0.0" from the root project
npm error
npm error Could not resolve dependency:
npm error peer @angular/compiler-cli@"^19.0.0 || ^19.1.0-next.0 || ^19.2.0-next.0" from [email protected]
npm error node_modules/ng-packagr
npm error   dev ng-packagr@"^19.0.0" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:
npm error /home/runner/.npm/_logs/2025-08-04T11_57_47_528Z-eresolve-report.txt
npm error A complete log of this run can be found in: /home/runner/.npm/_logs/2025-08-04T11_57_47_528Z-debug-0.log
openapi-generator version

I have tested it with the following versions: 7.14.0, 7.13.0

Generation Details

This is how my openapitools.json file looks like:

{
   "$schema": "../../node_modules/@openapitools/openapi-generator-cli/config.schema.json",
   "spaces": 3,
   "generator-cli": {
      "version": "7.14.0",
      "generators": {
         "typescript-angular": {
            "generatorName": "typescript-angular",
            "glob": "./generated/swagger.json",
            "output": "./generated/typescript-angular/",
            "additionalProperties": {
               "enumPropertyNaming": "UPPERCASE",
               "fileNaming": "kebab-case",
               "stringEnums": true,
               "supportsES6": true,
               "ngVersion": "19.0.0",
               "useSingleRequestParameter": true
            }
         }
      }
   }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions