[BUG] [typescript-axios] Unused imports when using 'withSeparateModelsAndApi'
Created by: Nikos410
Bug Report Checklist
-
Have you provided a full/minimal spec to reproduce the issue? -
Have you validated the input using an OpenAPI validator (example)? -
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?
Description
Hello! When using the typescript-axios client generator with the additional property withSeparateModelsAndApi
unused imports are sometimes created.
openapi-generator version
6.0.1 / master
OpenAPI declaration file content or url
https://gist.github.com/Nikos410/32ab8c734b8f9a50adee138aba623f49
Generation Details
openapi-generator-cli generate -i ./openapi-spec-with-inheritance.json -g typescript-axios --additional-properties=withSeparateModelsAndApi=true --additional-properties=apiPackage=apis --additional-properties=modelPackage=models -o ./generated
Steps to reproduce
- Generate the typescript-axios client using the spec and cli command above.
- Notice unused import of
BranchDto
inmodels/internal-authenticated-user-dto.ts
andmodels/remote-authenticated-user-dto.ts
:
[...]
import { AbstractUserDto } from './abstract-user-dto';
import { BranchDto } from './branch-dto';
/**
* @type RemoteAuthenticatedUserDto
* @export
*/
export type RemoteAuthenticatedUserDto = AbstractUserDto;
Related issues/PRs
A similar issue was already reported in #3743 (closed) and fixed in #3742 by adding // @ts-ignore
Suggest a fix
Add // @ts-ignore
to these imports too
CC @Digirik