OpenAPITools / openapi-generator-cli

A node package wrapper for https://github.com/OpenAPITools/openapi-generator
Apache License 2.0
1.47k stars 154 forks source link

[BUG] typescript-axios putting axios@0.27.4 in generated package.json #793

Closed oliviercperrier closed 3 months ago

oliviercperrier commented 3 months ago

⚠️ Important Notice

Please differentiate the bug

This repository is not responsible for the actual code generation. If you have problems with the code generation, please open the bug at OpenAPITools/openapi-generator.

Please also check if the bug is already known before you open a new bug.


🐛 Bug Report:

Describe the bug

Im currently generating an api client and im using the latest version of axios in my code. But the generated api client -> package.json contains the following dependency:

  "dependencies": {
    "axios": "^0.27.2"
  },

Im also trying to override the axios version using:

--additional-properties=axiosVersion=1.7.4

But nothing happens.

Steps to Reproduce

Just generate any api using typescript-axios.

npx openapi-generator-cli generate \
    -i ./dist/api.json \
    -o ./api-client \
    --generator-name typescript-axios \
    --additional-properties=withSeparateModelsAndApi=true \
    --additional-properties=withInterfaces=true \
    --additional-properties=axiosVersion=1.7.4

Expected behavior

axios version in generated client package.json should not be 0.27.4 but 1.7.4

Screenshots

If applicable, add screenshots to help explain your problem.

Operation System (please complete the following information):

Package System (please complete the following information):

Additional context

Add any other context about the problem here.

oliviercperrier commented 3 months ago

I needed to update the version in my openapitools.json