-
-
Notifications
You must be signed in to change notification settings - Fork 218
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
fix(core): consider message
when de-duplicating results
#2052
Conversation
Before this change, the `code` and `path` of the results were the primary factors considered in de-duplication. Results that came from the same rule and same OpenAPI artifact but had different messages were de-duplicated and not all unique results were returned. This change updates the logic to take `message` into account so that all unique results are displayed to the user.
Hey! |
This is a welcome change! I think many users will benefit from this. Great work @dpopp07! |
packages/rulesets/src/oas/__tests__/duplicated-entry-in-enum.test.ts
Outdated
Show resolved
Hide resolved
packages/rulesets/src/oas/__tests__/duplicated-entry-in-enum.test.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
# [@stoplight/spectral-core-v1.10.1](https://github.com/stoplightio/spectral/compare/@stoplight/spectral-core-v1.10.0...@stoplight/spectral-core-v1.10.1) (2022-02-14) ### Bug Fixes * **core:** consider `message` when de-duplicating results ([#2052](#2052)) ([b07cc7b](b07cc7b))
🎉 This PR is included in version @stoplight/spectral-core-v1.10.1 🎉 The release is available on npm package (@latest dist-tag) Your semantic-release bot 📦🚀 |
Before this change, the
code
andpath
of the results were the primary factorsconsidered in de-duplication. Results that came from the same rule and same OpenAPI
artifact but had different messages were de-duplicated and not all unique results
were returned.
This change updates the logic to take
message
into account so that all uniqueresults are displayed to the user.
I added a new test to confirm the behavior. I also updated an existing test - one of the tests resulted in multiple results returned for the same OpenAPI artifact with different error messages. I looked into addressing the extra rules but in this case, they are a little bit redundant and so I updated the tests to make the additional results expected. Let me know how you feel about this as an approach.
I also removed the outdated docs about custom de-duplication logic.
Fixes #2038
Checklist
Does this PR introduce a breaking change?