We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
null
Describe the bug
myProperty: type: string nullable: true default: null
fails validation with an obscure error message:
Cannot read properties of null (reading 'in') error Command failed with exit code 2.
Setting null as default value is perfectly fine which has been clarified in the spec version 3.0.3. See: OAI/OpenAPI-Specification#2057 (comment) and OAI/OpenAPI-Specification#2115 (comment).
To Reproduce
cat <<EOF > test.yaml openapi: 3.0.3 components: schemas: myProperty: type: string default: null nullable: true EOF
yarn spectral lint test.yaml
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
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.
The text was updated successfully, but these errors were encountered:
This should be fixed by #1986. LMK if it works. Just make sure to upgrade @stoplight/spectral-rulesets beforehand.
@stoplight/spectral-rulesets
Sorry, something went wrong.
I'll close this one out in the meantime. If you experience issues, please reach out here. Thank you!
I can confirm it's solved Thanks! ❤️
P0lip
No branches or pull requests
Describe the bug
fails validation with an obscure error message:
Setting
null
as default value is perfectly fine which has been clarified in the spec version 3.0.3.See: OAI/OpenAPI-Specification#2057 (comment) and OAI/OpenAPI-Specification#2115 (comment).
To Reproduce
yarn spectral lint test.yaml
Expected behavior
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.
The text was updated successfully, but these errors were encountered: