Skip to content

Code generation fails for path parameters of type array that have no items specified #267

@Sjeiti

Description

@Sjeiti

While this is legal in Swagger 2.0

swagger: 2.0
(...)
paths:  /search:
    get:
      (...)
      parameters:
        - name: term
          in: query
          description: search string
          required: false
          type: string

ng-swagger-gen will fail with Error: TypeError: Cannot read property 'type' of undefined because it expects the items to be defined (like so):

swagger: 2.0
(...)
paths:  /search:
    get:
      (...)
      parameters:
        - name: term
          in: query
          description: search string
          required: false
          type: string
          items:
            type: string

This can be fixed by defaulting type itemType (ln 908) to string

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions