Skip to content
Last updated

no-step-requestBody-with-workflowId

Disallows the requestBody field in a step that uses workflowId.

ArazzoCompatibility
1.x✅

Design principles

The Arazzo specification defines the requestBody of a step as the request body to pass to an operation. A step that uses workflowId runs another workflow instead of calling an operation, so it has no request to carry the body. The specification does not define what happens to such a requestBody, and a tool can ignore it without telling you.

To pass values to the workflow, use the parameters of the step. They map to the inputs of the workflow.

The specification does not forbid the field with a MUST NOT, and the Arazzo JSON Schema accepts requestBody in every step. That is why the struct rule does not report it, and why the no-step-requestBody-with-workflowId rule is not part of the spec ruleset.

Configuration

OptionTypeDescription
severitystringPossible values: off, warn, error. Default: warn (in recommended configuration).

An example configuration:

rules:
  no-step-requestBody-with-workflowId: error

Examples

Given the following configuration:

rules:
  no-step-requestBody-with-workflowId: error

Example of an incorrect step:

workflows:
  - workflowId: order-for-ada
    steps:
      - stepId: create-order
        workflowId: create-order
        requestBody:
          payload:
            customerName: Ada

Example of correct steps:

workflows:
  - workflowId: create-order
    inputs:
      type: object
      properties:
        customerName:
          type: string
    steps:
      - stepId: create-order
        operationId: cafe-api.createOrder
        requestBody:
          payload:
            customerName: $inputs.customerName
  - workflowId: order-for-ada
    steps:
      - stepId: create-order
        workflowId: create-order
        parameters:
          - name: customerName
            value: Ada

Resources