Repository navigation
fix(rulesets): guard null definitions in oas2-discriminator given - #3098
Merged
Michał Rychel (micryc) merged 1 commit intoNov 3, 2026
Merged
Michał Rychel (micryc) merged 1 commit into
Michał Rychel (micryc) merged 1 commit into
Conversation
Michał Rychel (micryc)
approved these changes
Nov 3, 2026
Contributor
|
Hi Amir (@fredrikblau) thank you for your contribution, it will be included in next spectral release 🥳 |
Stoplighticus Roboticus (stoplight-bot)
pushed a commit
that referenced
this pull request
Nov 6, 2026
## [6.17.1](https://github.com/stoplightio/spectral/compare/@stoplight/spectral-cli-6.17.0...@stoplight/spectral-cli-6.17.1) (2026-11-06) ### Bug Fixes * **cli:** lint files whose names contain glob characters ([#3101](#3101)) ([bf782be](bf782be)), closes [#2814](#2814) * **cli:** switch binary target to node22 ([#3080](#3080)) ([1355fa6](1355fa6)) * **core:** resolve a redefined rule's given against the aliases of its ruleset ([#3089](#3089)) ([6497ddd](6497ddd)), closes [#3085](#3085) * **functions:** clearer schema errors for array items and oneOf/anyOf ([#3095](#3095)) ([5c566df](5c566df)), closes [#1072](#1072) * **functions:** republish 1.11.1 after failed release ([#3104](#3104)) ([d5da3c0](d5da3c0)) * **rulesets:** guard null definitions in oas2-discriminator given ([#3098](#3098)) ([74a5fe0](74a5fe0)) * **rulesets:** relaxRequired does not traverse "not" schemas ([#3083](#3083)) ([95ab37e](95ab37e)), closes [#3068](#3068)
Stoplighticus Roboticus (stoplight-bot)
pushed a commit
that referenced
this pull request
Nov 6, 2026
## [1.24.1](https://github.com/stoplightio/spectral/compare/@stoplight/spectral-core-1.24.0...@stoplight/spectral-core-1.24.1) (2026-11-06) ### Bug Fixes * **cli:** lint files whose names contain glob characters ([#3101](#3101)) ([bf782be](bf782be)), closes [#2814](#2814) * **cli:** switch binary target to node22 ([#3080](#3080)) ([1355fa6](1355fa6)) * **core:** resolve a redefined rule's given against the aliases of its ruleset ([#3089](#3089)) ([6497ddd](6497ddd)), closes [#3085](#3085) * **functions:** clearer schema errors for array items and oneOf/anyOf ([#3095](#3095)) ([5c566df](5c566df)), closes [#1072](#1072) * **functions:** republish 1.11.1 after failed release ([#3104](#3104)) ([d5da3c0](d5da3c0)) * **rulesets:** guard null definitions in oas2-discriminator given ([#3098](#3098)) ([74a5fe0](74a5fe0)) * **rulesets:** relaxRequired does not traverse "not" schemas ([#3083](#3083)) ([95ab37e](95ab37e)), closes [#3068](#3068)
Stoplighticus Roboticus (stoplight-bot)
pushed a commit
that referenced
this pull request
Nov 6, 2026
## [1.23.1](https://github.com/stoplightio/spectral/compare/@stoplight/spectral-rulesets-1.23.0...@stoplight/spectral-rulesets-1.23.1) (2026-11-06) ### Bug Fixes * **cli:** lint files whose names contain glob characters ([#3101](#3101)) ([bf782be](bf782be)), closes [#2814](#2814) * **cli:** switch binary target to node22 ([#3080](#3080)) ([1355fa6](1355fa6)) * **core:** resolve a redefined rule's given against the aliases of its ruleset ([#3089](#3089)) ([6497ddd](6497ddd)), closes [#3085](#3085) * **functions:** clearer schema errors for array items and oneOf/anyOf ([#3095](#3095)) ([5c566df](5c566df)), closes [#1072](#1072) * **functions:** republish 1.11.1 after failed release ([#3104](#3104)) ([d5da3c0](d5da3c0)) * **rulesets:** guard null definitions in oas2-discriminator given ([#3098](#3098)) ([74a5fe0](74a5fe0)) * **rulesets:** relaxRequired does not traverse "not" schemas ([#3083](#3083)) ([95ab37e](95ab37e)), closes [#3068](#3068) ### Features * **repo:** minor release trigger ([#3079](#3079)) ([eabafec](eabafec))
Collaborator
|
🎉 This PR is included in version 1.23.1 🎉 The release is available on Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #2964.
The
spectral:oascases reported in the issue (duplicated-entry-in-enum/typed-enumhitting null nodes) already lint cleanly on develop since #2963. Running every built-ingivenfilter against a document full of nulls turned up one that still throws:oas2-discriminator($.definitions[?(@.discriminator)]). A Swagger 2 document with a null definition aborts the whole run withCannot read properties of null (reading 'discriminator').This adds the same
@ &&guard the other OAS rules use, with a regression test for it and one for the OAS 3.1 nullable enum document from the issue. Custom rules with unguarded filters (the first example in the issue) can still throw; that would need a change in the runner, so I left the issue open.Checklist
Does this PR introduce a breaking change?