spectral:arazzo error on by default

arazzo-workflow-stepId-unique

Every step must have unique "stepId".

Applies to
workflows
Selects
$.workflows[*]
Function
arazzoStepIdUniqueness
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-workflow-stepId-unique: error   # or off, or another severity

Definition

As defined in @openlint/openlint-rulesets. Functions show by name.

arazzo-workflow-stepId-unique:
  description: Every step must have unique "stepId".
  message: '{{error}}'
  severity: 0
  given: '$.workflows[*]'
  then:
    function: arazzoStepIdUniqueness

About this rule

Every stepId defined within a workflow must be unique

Good Example

workflows:
  - workflowId: someWorkflow
    parameters:
      - in: cookie
        name: workflowLevelParamOne
        value: someValue
      - in: header
        name: workflowLevelParamTwo
        value: someValue
    steps:
      - stepId: post-step
        parameters:
          - in: cookie
            name: foo
            value: some_value
        operationId: createResource
      - stepId: get-step
        operationId: getResource

Bad Example

workflows:
  - workflowId: someWorkflow
    parameters:
      - in: cookie
        name: workflowLevelParamOne
        value: someValue
      - in: header
        name: workflowLevelParamTwo
        value: someValue
    steps:
      - stepId: post-step
        parameters:
          - in: cookie
            name: foo
            value: some_value
        operationId: createResource
      - stepId: post-step
        operationId: getResource

Sources