FAQ

  • GitHub GitHub Repo stars
  • Discord Discord Server
  • ✨ New! Try the OpenAPI Doctor ✨ The OpenAPI Doctor
    Recommended

    arazzo-parameter


    Formats: Severity:

    arazzo-parameter checks the parameters a step sends against the operation it sends them to.

    Why did this violation appear?

    A step supplies a parameter that the target operation does not declare, or the parameter is not valid for that kind of target.

    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
            parameters:
              - name: petId
                in: path
                value: 1
    

    The read operation in api.yaml is GET /pets. It has no petId path parameter.

    parameter "petId" in path is not declared by the target operation
    

    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?

    Match the parameter name and in to what the operation declares, or remove the parameter. If the workflow is right, the API description is the thing that needs updating.

    This rule reports findings from vacuum’s shared Arazzo validation pass, using the arazzoDocument function.