flowup / api-client-generator

Angular REST API client generator from Swagger YAML or JSON file with camel case settigs
MIT License
115 stars 21 forks source link

[models] generate interface with map attribute #61

Closed mrkpks closed 6 years ago

mrkpks commented 6 years ago

Properties with additionalProperties should be generated as the keymap

Example INPUT:

myInterface:
  type: "object"
  properties:
    myName:
      type: "string"
    myId:
      type: "string"
    myMap:
      type: "object"
      additionalProperties:
        $ref: "#/definitions/someOtherInterface"

OUTPUT:

export interface MyInterface {
  myName: string;
  myId: string;
  myMap: {[key: string]: SomeOtherInterface};
}