Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #13203
Closed
Open
Issue created Aug 17, 2022 by Administrator@rootContributor5 of 5 checklist items completed5/5 checklist items

[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 in models/internal-authenticated-user-dto.ts and models/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

Assignee
Assign to
Time tracking