Skip to main content

OpenAPI (OAD) Plugin

The OAD plugin is the primary driver for spec-first verification, mapping OpenAPI 3.0/3.1 operations to Drift test cases.

1. Mapping Operations

Each test operation in Drift maps to an endpoint in your OpenAPI file via the target property.

operations:
getAllValues:
target: my-OAD:getProductByID # Points to the operationId in the OAD
description: "Get all values"

2. Setting Parameters

Drift automatically maps values from the parameters section of your YAML to the corresponding path, query, or header requirements in the OAD.

operations:
getProduct:
target: my-OAD:getProductByID
parameters:
path:
id: 100
query:
value: test

3. Bound Context Values

You can reference metadata from the current operation in the OAD as a bound value. This is useful for using spec-defined examples as test inputs.

parameters:
path:
id: ${my-OAD:operation.parameters.id.example} # Injects the example from the spec
query:
value: ${my-OAD:operation.summary} # Injects the summary text

Supported Metadata Properties:

  • tags, summary, description, operationId.
  • parameters (including example, examples, and extensions via ext).
  • deprecated and extensions (via ext).