arazzo-source-type
arazzo-source-type checks that sources are used for what they are. An operationId needs an OpenAPI or AsyncAPI source. A workflowId needs an Arazzo source. And the document behind a source has to be the type the workflow declared.
Why did this violation appear?
A step points at the wrong kind of source, a source’s declared type does not match the document that was loaded, or an AsyncAPI-only field is used on a step that isn’t AsyncAPI.
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.
workflowId: $sourceDescriptions.api.read
api is an OpenAPI source. It has operations, it doesn’t have workflows.
workflow reference requires an Arazzo source
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?
Use operationId for OpenAPI and AsyncAPI sources and workflowId for Arazzo sources. If the type on the source description is wrong, correct it.
This rule reports findings from vacuum’s shared Arazzo validation pass, using the arazzoDocument function.
