OpenAPITools / OpenAPITools/openapi-generator

[BUG] typescript-axios does not change reserved type in reference

Open
#9,639 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Issue: Bug
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Description

I'm using docker version and genreate api. I have declaration "Error" in my swagger and reference on it in declaration (Response).
I get error message, that "Error" is busy and will replaced with ModelError.
When i check generated files Error declaration was renamed, but link on it in "Response" - not

openapi-generator version

3.0.1

OpenAPI declaration file content or url

Link

Generation Details
docker run --rm \
  -v ${PWD}/libs/api:/local  openapitools/openapi-generator-cli generate \
  -i /local/swagger2.json \
  -g typescript-axios \
  -o /local/src/api \
  --skip-validate-spec \
  --additional-properties=useSingleRequestParameter=true
Steps to reproduce

Just run command

Suggest a fix

I found solution, but looks not good for me, i've added
--type-mappings Error=ModelError

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

Reproduce the issue with the linked OpenAPI declaration and the shown typescript-axios Docker command. Compare the renamed Error model with the reference used by Response; done means generated references point to the renamed model consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, typescript
Domain
api, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.