spectral
spectral copied to clipboard
Support OR combinator
It would be very helpful if Spectral could support some sort of OR combinator where I can define multiple functions to apply. If one of them passes, the validation is marked as ✅
given: >-
$...parameters[*].name
then:
or:
- function: casing
functionOptions:
type: snake
- function: casing
functionOptions:
type: camel
Probably a general thought on other logic functions could be useful (eg. negating function, negating then). Such a mechanism allows to implement or like that:
then_not:
- function: casing
expect: false
functionOptions: {type: snake}
- ...
via De Morgan.
We talked about having a "not" today, which is probably related to this.