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.roleType 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_atThe 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
$nameto reference extracted variables inASSERTS - Use
"{{name}}"for template substitution in JSON payloads