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.
Use x-operation as part of a Step object.
| Field Name | Type | Description |
|---|---|---|
| url | string | REQUIRED. A valid URL including the protocol (such as http://localhost:4000/my-api or https://example.com/api/my-api) or a Runtime Expression (e.g., $steps.<STEP_ID>.outputs.<OUTPUT_NAME>) . |
| method | string | REQUIRED. HTTP operation method. Possible values: GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS, CONNECT, TRACE. You can also use their lowercase equivalents. |
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 == 200The successCriteria fields work in the same way as other operation types.
Use the output from the previous step response to define your request url:
steps:
- stepId: file-upload
operationId: $sourceDescriptions.openapi.FileUpload
outputs:
upload_file_url: $response.body#/uploaded_file_url
- stepId: get-uploaded-file-by-url
x-operation:
url: $steps.file-upload.outputs.upload_file_url
method: get- x-security extension lets you apply OpenAPI security schemes to a step request.
- Respect commands list.
- Learn about Arazzo.