arazzo-reference
arazzo-reference checks that everything a workflow points at actually exists. Operations in OpenAPI and AsyncAPI sources, workflows in other Arazzo documents, and steps named in runtime expressions.
This is the rule that catches a workflow drifting away from its API.
Why did this violation appear?
A step, expression or action refers to an operation, workflow, step or source that vacuum could not find.
Bad example
arazzo: 1.0.1
info:
title: Read a pet
version: '1.0'
description: Retrieve a pet from the API.
summary: Read a pet.
sourceDescriptions:
- name: api
url: api.yaml
type: openapi
workflows:
- workflowId: readPet
description: Retrieve a pet.
summary: Read a pet.
steps:
- stepId: read
description: Call the read operation.
operationId: $sourceDescriptions.api.missing
api.yaml has no operation called missing.
workflows.yaml:18:22 ✗ operation "missing" does not exist in source "api"
Good example
arazzo: 1.0.1
info:
title: Read a pet
version: '1.0'
description: Retrieve a pet from the API.
summary: Read a pet.
sourceDescriptions:
- name: api
url: api.yaml
type: openapi
workflows:
- workflowId: readPet
description: Retrieve a pet.
summary: Read a pet.
steps:
- stepId: read
description: Call the read operation.
operationId: $sourceDescriptions.api.read
How do I fix this violation?
Check the target against the source document. Usually the operation was renamed or removed, or there’s a typo in the workflow. Fix whichever side is wrong.
This rule needs to read your sources. If a source can’t be loaded because lookup is disabled, you get an arazzo-validation-incomplete warning instead.
This rule reports findings from vacuum’s shared Arazzo validation pass, using the arazzoDocument function.
