Skip to main content

Validation ([assert])

The [assert] section allows you to define automated tests for your API responses. If any assertion fails, the node is marked as failed, and the self-healing and retry engines may trigger automatically.

Rumour provides a highly granular validation engine capable of inspecting everything from basic HTTP metadata to deeply nested JSON properties and response schemas.

Available Assertion Types

We have broken down the assertion documentation into dedicated guides based on what part of the response you want to validate:

  1. HTTP Status Validation Assert that the response returns an exact status code (e.g., 200) or falls within a specific range (e.g., 200-299).

  2. Response Body Validation Perform fast, global substring searches across the raw response payload to quickly verify the presence of an ID, success message, or error code.

  3. JSON Path Assertions Target specific fields deep inside a JSON response using dot notation (e.g., data.users[0].email) to enforce exact values, numeric constraints, or existence.

  4. Response Header Assertions Inspect HTTP response headers to verify content types, caching directives, or custom security tokens.

  5. JSON Schema Validation Validate the entire structural integrity of a response payload against a Draft-07 JSON Schema.

  6. Regex Field Inferences Apply powerful regular expressions to validate complex string formats like emails, UUIDs, or custom tokens inside JSON fields or headers.

  7. Performance Validation (SLAs) Enforce strict timing constraints to guarantee endpoints return data within your required Service Level Agreements, and profile individual network phases.

Assertion Evaluation & Diagnostics

Rumour evaluates all assertions defined on a request rather than short-circuiting on the first failure. This means if a request fails its status check, schema validation, and duration SLA simultaneously, the CLI will report all three failures in a single trace to give you a complete picture of what broke.

When an assertion fails, the execution report will dump exactly what value it expected versus what the server actually returned.