Skip to content

[BUG][Typescript Angular] Broken imports with modelSuffix #13883

@iceteabottle

Description

@iceteabottle

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?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

The import paths of models are broken when the option --modelSuffix is used.

// Generated e.g. with v6.2.1

import { InlineResponse200178MyTestApi } from '../model/inlineResponse200178MyTestApi'; // broken

But the file ../model/inlineResponse200178MyTestApi doesn't exists. The file name has no suffix.

//Generated with v7.0.0 (openapi-generator-cli-7.0.0-20221012.083708-4.jar)

import { InlineResponse200178MyTestApi } from '../model/inlineResponse200178'; // expected

Since you already fixed it in the new major version is there any chance that this bug could be fixed also in 6.x?

openapi-generator version

All versions >= 5.2 and < 7.0.0

OpenAPI declaration file content or url

Reproducible e.g. with https://app.swaggerhub.com/apis/binance_api/BinanceSpotAPI/1.0#/Market/get_api_v3_trades

Generation Details
$ openapi-generator-cli generate -i binance_api-BinanceSpotAPI-1.0-resolved.json -g typescript-angular -o my-test-api/src --additional-properties apiModulePrefix=MyTest,configurationPrefix=MyTestApi,enumNameSuffix=MyTestApi,modelSuffix=MyTestApi,serviceSuffix=MyTestApiService --global-property skipFormModel=false
Steps to reproduce

Generate the linked api with the command above and check the imports in e.g. the file convert.service.ts.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions