arazzo-selector
arazzo-selector checks the selectors a workflow uses to reach inside a payload, such as the target of a request body replacement.
Why did this violation appear?
A selector or replacement target is not valid syntax for its dialect (JSON Pointer or JSONPath).
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.read
requestBody:
contentType: application/json
payload: {}
replacements:
- target: name
value: Fido
For a JSON payload, target is a JSON Pointer. A JSON Pointer starts with /.
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
requestBody:
contentType: application/json
payload: {}
replacements:
- target: /name
value: Fido
How do I fix this violation?
Fix the selector syntax for the dialect in use.
XPath selectors can’t be statically checked. They are reported as arazzo-validation-incomplete warnings.
This rule reports findings from vacuum’s shared Arazzo validation pass, using the arazzoDocument function.
