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

Bug: Validation Error with @stoplight/spectral-rulesets 1.19.0 #2637

Closed
tomo-kn opened this issue Jun 9, 2024 · 3 comments · Fixed by #2638
Closed

Bug: Validation Error with @stoplight/spectral-rulesets 1.19.0 #2637

tomo-kn opened this issue Jun 9, 2024 · 3 comments · Fixed by #2638
Labels

Comments

@tomo-kn
Copy link

tomo-kn commented Jun 9, 2024

Describe the bug
After upgrading to @stoplight/spectral-rulesets version 1.19.0, we encountered a validation error that was not present in version 1.18.1.

The error message indicates a problem with spectral, specifically a TypeError: Cannot read properties of null (reading 'type').

[ERROR] There was a problem with spectral.
[ERROR] Cannot read properties of null (reading 'type')
[ERROR] Additional error details:
[ERROR] TypeError: Cannot read properties of null (reading 'type')
at $..[?(@.type === 'array')] (eval at query (/data/node_modules/nimma/dist/legacy/cjs/core/index.js:66:71), <anonymous>:10:31)
at eval (eval at query (/data/node_modules/nimma/dist/legacy/cjs/core/index.js:66:71), <anonymous>:182:41)
at _traverseBody (/data/node_modules/nimma/dist/legacy/cjs/runtime/traverse.js:13:5)
at _traverse (/data/node_modules/nimma/dist/legacy/cjs/runtime/traverse.js:41:7)
at _traverseBody (/data/node_modules/nimma/dist/legacy/cjs/runtime/traverse.js:17:5)
at _traverse (/data/node_modules/nimma/dist/legacy/cjs/runtime/traverse.js:41:7)
at _traverseBody (/data/node_modules/nimma/dist/legacy/cjs/runtime/traverse.js:17:5)
at _traverse (/data/node_modules/nimma/dist/legacy/cjs/runtime/traverse.js:41:7)
at _traverseBody (/data/node_modules/nimma/dist/legacy/cjs/runtime/traverse.js:17:5)
at _traverse **(/data/node_modules/nimma/dist/legacy/cjs/runtime/traverse.js:41:7)

To Reproduce

  1. Upgrade to @stoplight/spectral-rulesets version 1.19.0.
  2. Run the OpenAPI validation using ibm-openapi-validator or spectral.
  3. Observe the validation error

Expected behavior
The OpenAPI validation should pass without any errors, as it did with @stoplight/spectral-rulesets version 1.18.1.

@mi-wada
Copy link

mi-wada commented Jun 10, 2024

We encountered the same error. By adding the following configuration to .spectral.yaml to disable the array-items rule, the error was muted.

rules:
  array-items: off

It appears that array-items was added in @stoplight/spectral-rulesets 1.19.0 . There may be a bug in this rule 🤔

@rainum
Copy link
Contributor

rainum commented Jun 10, 2024

@tomo-kn, thanks for reporting this issue rapidly! It should be fixed by #2638. Sorry for the inconvenience that we may caused!

@stoplight-bot
Copy link
Collaborator

🎉 This issue has been resolved in version 1.19.1 🎉

The release is available on @stoplight/spectral-rulesets-1.19.1

Your semantic-release bot 📦🚀

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

Successfully merging a pull request may close this issue.

4 participants