Skip to content
Last updated

x-operation enables you to specify a URL and HTTP method for an operation that is not described in the Arazzo sourceDescriptions section. The primary application of the x-operation extension is to facilitate calls to third-party APIs or other endpoints that are needed in a sequence of API calls.

Location

Use x-operation as part of a Step object.

x-operation Object

Field Name Type Description
urlstringREQUIRED. A valid url including the protocol (such as http://localhost:4000/my-api or https://example.com/api/my-api).
methodstringREQUIRED. HTTP operation method. Possible values: GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS, CONNECT, TRACE. You can also use their lowercase equivalents.

Example

Make an HTTP request not described in an OpenAPI description as part of a workflow.

steps:
  - stepId: get-first-post
    x-operation:
      url: https://jsonplaceholder.typicode.com/posts/1
      method: GET
    successCriteria:
      - condition: $statusCode == 200

The successCriteria fields work in the same way as other operation types.

Resources