arazzo-step-success-criteria-validation
Every success criteria must have a valid context, conditions, and types.
- Applies to
workflows- Selects
$.workflows[*]- Function
arazzoStepSuccessCriteriaValidation- Specs
- Arazzo 1.0
- Message
{{error}}
Use it
This rule ships with OpenLint in spectral:arazzo. Extending the ruleset turns it on:
extends: spectral:arazzo
rules:
arazzo-step-success-criteria-validation: error # or off, or another severity
Definition
As defined in @openlint/openlint-rulesets. Functions show by name.
arazzo-step-success-criteria-validation:
description: 'Every success criteria must have a valid context, conditions, and types.'
message: '{{error}}'
severity: 0
given: '$.workflows[*]'
then:
function: arazzoStepSuccessCriteriaValidation
About this rule
Every success criteria must have a valid context, conditions, and types.
Rule checks:
conditionmust be specified- if
typeis defined then acontextmust be provided - if
typeis an object then it must conform to an Arazzo Specification Criterion Expression Type Object - if
typeis specified as “regex”, then the condition must be a valid regex contextmust be a valid Arazzo Specification Runtime Expressions
Good Example
- context: $statusCode
condition: "^200$"
type: regex
Bad Example
- context: hello
condition: "^200$"
type: regex