apiaryio / fury-adapter-swagger

Swagger 2.0 parser adapter for Fury.js
MIT License
11 stars 12 forks source link

Handle empty parameter items with missing type #154

Closed kylef closed 6 years ago

kylef commented 6 years ago

Spotted parameters in the wild causing the parser to raise an exception due to type being undefined:

        - name: xxx
          in: query
          required: false
          type: array
          items: {}
          collectionFormat: multi
   1) Parameter to Member converter can convert a parameter to a member with array empty items

       Type is not a constructor

       at Parser.convertParameterToElement (src/parser.js:1284:19)

       1284 |     let element = new Type();

       at Parser.<anonymous> (src/parser.js:1334:33)

       1333 |       this.withPath('items', () => {
       1334 |         element.content = [this.convertParameterToElement(parameter.items, true)];
       1335 |       });