stoplightio / spectral

A flexible JSON/YAML linter for creating automated style guides, with baked in support for OpenAPI v3.1, v3.0, and v2.0 as well as AsyncAPI v2.x.
https://stoplight.io/spectral
Apache License 2.0
2.35k stars 226 forks source link

feat(rulesets): add multiple xor #2614

Closed JeanArhancet closed 2 months ago

JeanArhancet commented 2 months ago

Closes #2396

Checklist

Does this PR introduce a breaking change?

This PR enhances the XOR core function to support scenarios involving more than two properties, allowing for expanded logical evaluations across multiple attributes.

cuttingclyde commented 2 months ago

@mnaumanali94 , I'm glad to see that this issue (xor functionality limited to 2 properties) has gotten attention and adoption. Please also review my PR #2616 which extends the functionality further--can be 1 property, no maximum limit, and documentation updates--and also adds a similar "or" function.

cuttingclyde commented 2 months ago

My PR #2616 has now been merged with this PR #2614. "feat(rulesets): add multiple xor", and rest of spectral develop branch.

JeanArhancet commented 1 month ago

Thanks for the approval/merge, @mnaumanali94. Is it possible to deploy these features in a new release version?

stoplight-bot commented 1 month ago

:tada: This PR is included in version 1.19.0 :tada:

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

Your semantic-release bot :package::rocket: