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

Linter reports an error when using unevaluetedProperties as boolean #620

Closed
AlbertoFdzM opened this issue Apr 5, 2022 · 1 comment · Fixed by #640
Closed

Linter reports an error when using unevaluetedProperties as boolean #620

AlbertoFdzM opened this issue Apr 5, 2022 · 1 comment · Fixed by #640

Comments

@AlbertoFdzM
Copy link
Contributor

AlbertoFdzM commented Apr 5, 2022

Describe the bug

Linter reports an error whenever unevaluatedProperties is use as a boolean:

Expected type `Schema` (object) but got `boolean`

To Reproduce

Steps to reproduce the behavior:

  1. Given this .redocly.yaml file

.redocly.yaml

lint:
  extends:
    - recommended
  rules:
    info-license: off
    operation-4xx-response: off
    no-empty-servers: off
  1. And this OpenAPI file(s)

openapi.yml

openapi: 3.1.0

info:
  title: Bug
  version: 0.0.0
  description: Bug

paths:
  /tests:
    get:
      summary: Reproduces the bug
      operationId: reproduceBug
      responses:
        200:
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - type: object
                    properties:
                      foo:
                        type: string
                  - type: object
                    properties:
                      bar:
                        type: number
                unevaluatedProperties: false
  1. Run this command
npx --yes @redocly/openapi-cli lint openapi.yml
  1. See error
validating openapi.yml...
[1] openapi.yml:28:40 at #/paths/~1tests/get/responses/200/content/application~1json/schema/unevaluatedProperties

Expected type `Schema` (object) but got `boolean`

26 |       bar:
27 |         type: number
28 | unevaluatedProperties: false
29 |

Error was generated by the spec rule.


openapi.yml: validated in 19ms

❌ Validation failed with 1 error.
run `openapi lint --generate-ignore-file` to add all problems to the ignore file.

Expected behavior

To not report an error

Additional context

json-schema draft 2019-09

  • @redocly/openapi-cli: 1.0.0-beta.92
  • Node.js: v16.13.0

Related issues:

@AlexWehe
Copy link

AlexWehe commented Apr 5, 2022

This issue looks really interesting 🧐

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.

2 participants