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
  • #957
Closed
Open
Issue created Sep 03, 2018 by Administrator@rootContributor

[angular-typescript] Bug generating model with suffix

Created by: Ilya1vanov

Description

Generator tries to insert such import:

import { MapSwagger } from './modelMap';

when suffix is provided (e.g. Swagger) and model contains map inside (same for services which take map as parameter)

modelMap?: { [key: string]: any; };
openapi-generator version

3.2.2 3.2.3

OpenAPI declaration file content or url
{
  "supportES6": true,
  "providedInRoot": "true",
  "modelSuffix": "Swagger",
  "ngVersion": "6.1.4"
}
Command line used for generation
java -jar openapi-generator-cli.jar generate -g typescript-angular -c openapi-config.json -i $1 -o $2

where $1 and $2 are input and output.

Steps to reproduce
  1. Generate model from json like this:
    "Model": {
      "type": "object",
      "properties": {
        "modelMap": {
          "type": "object",
          "additionalProperties": {
            "type": "object"
          }
        },
      }
    },
  1. Pass any suffix to generator's options
Related issues/PRs
Suggest a fix/enhancement

Exclude native js classes from imports before suffix applied.

Assignee
Assign to
Time tracking