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

Lint incorrectly reports boolean schemas for array items as invalid #457

Closed
shabbyrobe opened this issue Nov 24, 2021 · 2 comments · Fixed by #532
Closed

Lint incorrectly reports boolean schemas for array items as invalid #457

shabbyrobe opened this issue Nov 24, 2021 · 2 comments · Fixed by #532
Assignees
Labels
p2 Type: Bug Something isn't working

Comments

@shabbyrobe
Copy link

shabbyrobe commented Nov 24, 2021

To Reproduce
Steps to reproduce the behavior:

  1. Given this .redocly.yaml file
    None

  2. And this OpenAPI file(s)

openapi.yml
openapi: 3.1.0

info:
  title: Bug
  version: 0.0.1
  description: "Bug"
  license:
    name: Unlicensed
    identifier: UNLICENSED
    url: http://invalid

servers:
- description: "yep"
  url: http://invalid

paths:
  /test:
    get:
      operationId: getTest
      summary: Get Test! Foo! Etc!
      responses:
        200:
          description: "200"
          content:
            application/json:
              schema:
                type: array
                prefixItems:
                  - type: "string"
                items: false
        400:
          description: "400"
          content:
            application/json:
              schema: { type: "object" }
  1. Run this command with these arguments... openapi ...
npx @redocly/openapi-cli lint ~/tmp/oasbug.yml
  1. See error
Expected type `Schema` (object) but got `boolean`

28 |         prefixItems:
29 |           - type: "string"
30 |         items: false
31 | 400:
32 |   description: "400"

Expected behavior
This is valid according to Draft 2020-12's test suite

openapi-cli Version(s)
What version of openapi-cli are you using?
1.0.0-beta.69

Node.js Version(s)
What version of node.js are you using?
16.10.0

@RomanHotsiy RomanHotsiy added Type: Bug Something isn't working p2 labels Nov 24, 2021
@RomanHotsiy
Copy link
Member

@shabbyrobe thanks for reporting.

@shabbyrobe
Copy link
Author

This seems to apply to unevaluatedProperties and unevaluatedItems too; the same kind of error is reported.

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

Successfully merging a pull request may close this issue.

3 participants