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

Validator blows up with message thing.parameters.map is not a function when "allOf" appears as the first child of a parameters block #101

Closed
ThomasBendaSEL opened this issue Aug 20, 2019 · 2 comments · Fixed by #104
Labels
bug Something isn't working released

Comments

@ThomasBendaSEL
Copy link

Using lint-openapi version 0.13.3

When an allOf appears (apparently illegally) as the first child of a parameters block on a path operation, rather than failing with a useful error message, it exits with:

[Error] There was a problem with a validator.
thing.parameters.map is not a function

A yaml file that (minimally?) reproduces the issue is here:

herp.yaml

---
openapi: 3.0.0
info:
  version: 0.0.1
  title: herp
  contact:
    name: yeah
    email: nobody@example.com

paths:
  /derp:
    get:
      parameters:
        allOf:
          - name: grog
            type: string
          - name: fnord
            type: string
      description: herp
      responses:
        "200":
          description: response

It would be preferable that it would fail with a message reflecting that the usage was unexpected or illegal.

@dpopp07
Copy link
Member

dpopp07 commented Aug 20, 2019

@tbenda-SEL Also agreed, the validator should be able to continue processing this.

FYI, this is illegal because allOf is a property of JSON Schema and is only allowed in an OpenAPI definition when describing a schema. The parameters object in an operation must be an array of parameter objects or $refs. You may have known that, just wanted to be complete 🙂

Thanks for posting

@dpopp07
Copy link
Member

dpopp07 commented Sep 9, 2019

🎉 This issue has been resolved in version 0.13.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants