Skip to content

EXTRACT

Extract values from response data for reuse in assertions and downstream requests.

When to use

  • Reuse IDs/tokens returned by service
  • Keep assertions concise when values are nested
  • Chain values across requests in multi-document tests

Minimal example

php
--- EXTRACT ---
user_id = .user.id
user_role = .user.role

Type annotations

Add :type to the variable name to propagate the type to assertions:

php
--- EXTRACT ---
price:number = .price
name:string = .user.name
created:time = .created_at

The type is then known in ASSERTS — no need to annotate again:

php
--- ASSERTS ---
$price >= 0
$name contains "hello"

Rules

  • Multiple extraction rules are allowed
  • The same variable name can't be assigned twice — a parse error
  • Keep rule names short and descriptive
  • Use $name to reference extracted variables in ASSERTS
  • Use "{{name}}" for template substitution in JSON payloads

Released under the MIT License.