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

Spectral parsing chokes on unexpected null values #1981

Open
wedi opened this issue Dec 2, 2021 · 4 comments
Open

Spectral parsing chokes on unexpected null values #1981

wedi opened this issue Dec 2, 2021 · 4 comments
Labels

Comments

@wedi
Copy link

wedi commented Dec 2, 2021

Describe the bug

Spectral fails with Cannot read properties of null (reading 'in') and exit code 2 when you use null where spectral doesn't expect it.

To Reproduce

  1. Given this

and more similar cases.

  1. Run this CLI command '....'

yarn spectral lint test.yaml

  1. See error

The error is always exactly the same:

yarn spectral lint test.yaml
yarn run v1.22.17
$ /Users/weise/code/spectral_example/node_modules/.bin/spectral lint test.yaml
Cannot read properties of null (reading 'in')
error Command failed with exit code 2.

Expected behavior
A clear and concise description of what's wrong or at least a hint where this happened. If you have a big file with $refs to other files it's trial and error (or diffing).

Environment (remove any that are not applicable):

yarn spectral --version     
yarn run v1.22.17
$ /Users/weise/code/spectral_example/node_modules/.bin/spectral --version
6.1.0
✨  Done in 0.87s.
@tinomthomas
Copy link

+1

@hakandilek
Copy link

null values are valid and needed especially for the enums. Is there a plan to fix this?

@mikekistler
Copy link

I have hit this multiple times now. Please bump up the priority on this.

@hakandilek
Copy link

Anyone bumping into this, please check your custom rules. You most probably have a null reference there.

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

No branches or pull requests

5 participants