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

Definitions with additional props transformed into invalid models #81

Closed paveltobias closed 5 years ago

paveltobias commented 5 years ago

Example Swagger

swagger: "2.0"

info:
  title: Example
  version: 0.0.1

host: ex.amp.le
basePath: /ex/amp/le/

schemes:
  - https

consumes:
  - application/json

produces:
  - application/json

paths:
  /dictionaries:
    get:
      responses:
        200:
          description: OK
          schema:
            $ref: "#/definitions/Dictionary"

definitions:
  Dictionary:
    type: object
    additionalProperties:
      $ref: "#/definitions/DictionaryItem"

  DictionaryItem:
    type: object
    properties:
      value:
        type: string
    required:
      - value

Expected Result (Excerpt)

export interface Dictionary {
  [key: string]: DictionaryItem;
}

Actual Result (Excerpt)

export interface Dictionary {
}