Skip to content

[BUG] angular ts -> imports to models in generated code are wrong when using modelSuffix #13590

@alfredJune

Description

@alfredJune

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

When using generator-cli version 6.2.0 instead of 5.4.0 the imports to the models are wrong when using a modelSuffix.
Version 6.2.0 (wrong)
import { TestUserTest } from '../model/testUserTest';
Version 5.4.0 (correct)
import { TestUserTest } from '../model/testUser';
The imports to the models have the modelSuffix in the File name, which is wrong

openapi-generator version

6.2.0

OpenAPI declaration file and settings

interface-test.json:

{
  "npmName": "apiTest",
  "npmVersion": "0.0.1",
  "taggedUnions": true,
  "supportsES6": true,
  "ensureUniqueParams": false,
  "api-name-suffix": "Test",
  "modelSuffix": "Test",
  "fileNaming": "camelCase",
  "useSingleRequestParameter": true
}

OpenApi definition.json:
https://gist.github.com/alfredJune/0d118a3a6d9bbf83c9df32a32fde490c

Steps to reproduce
  • generate: npx openapi-generator-cli generate -g typescript-angular -c ./test/interface-test.json -i ./test/definition.json -o ./test/generated

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