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

schema is invalid: data/required should be array #1464

Closed
rahuljain88 opened this issue Feb 23, 2021 · 1 comment
Closed

schema is invalid: data/required should be array #1464

rahuljain88 opened this issue Feb 23, 2021 · 1 comment

Comments

@rahuljain88
Copy link

Getting Error: schema is invalid: data/required should be array
at Ajv.validateSchema (/Users/rahulvageriya/.config/yarn/global/node_modules/ajv/lib/ajv.js:178:16)

When we used below JSON:

    - name: petId
      in: path
      required: true
      description: The id of the pet to retrieve
      type: string
      example: "1234567890"
  responses:
    '200':
      description: Expected response to a valid request 

But it worked fine when we use type or example under schema tag like below 👍

  • name: petId
    in: path
    required: true
    description: The id of the pet to retrieve
    schema :
    type: string
    example: "1234567890"

Is it possible to use this type and example Tag without schema.?

@epoberezkin
Copy link
Member

The usage context is not clear - there is no code sample - but the problem is required: true - it should be defined on the object level in the schema as the list of required properties

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants