Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Sjeiti opened this issue Nov 1, 2021 · 0 comments · May be fixed by #268
Open

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

Sjeiti opened this issue Nov 1, 2021 · 0 comments · May be fixed by #268

Comments

@Sjeiti
Copy link

Sjeiti commented Nov 1, 2021

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

@Sjeiti Sjeiti linked a pull request Nov 1, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant