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
  • #4698
Closed
Open
Issue created Dec 04, 2019 by Administrator@rootContributor

[REQ] typescript node should generate additional properties correctly

Created by: mosesonline

Is your feature request related to a problem? Please describe.

When an api decription has declared additional properties I cannot use the generated model for typescript-node.

Describe the solution you'd like

The generated model should have attributes with the type of the addional properties.

SomeClass :
      type: object
      properties:
        id:
          type: string
      additionalProperties:
        type: array
        items:
          type: string

=>

export class SomeClass {
    [key: string]: Array<string> | any;
    'id'?: string;

    static discriminator: string | undefined = undefined;

    static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
        {
            "name": "id",
            "baseName": "id",
            "type": "string"
        }    ];

    static getAttributeTypeMap() {
        return SomeClass .attributeTypeMap;
    }
}

Describe alternatives you've considered

none

Additional context

none

Assignee
Assign to
Time tracking