From 4dcf5dbd46499c4a1e7d5537537de8a7e09135c5 Mon Sep 17 00:00:00 2001 From: "mintlify[bot]" <109931778+mintlify[bot]@users.noreply.github.com> Date: Thu, 2 Apr 2026 20:22:43 +0000 Subject: [PATCH] Clarify isJson assertion accepts both objects and arrays Generated-By: mintlify-agent --- testing/tests/assertions.mdx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/testing/tests/assertions.mdx b/testing/tests/assertions.mdx index 4f9a04f9..28837fd0 100644 --- a/testing/tests/assertions.mdx +++ b/testing/tests/assertions.mdx @@ -94,7 +94,16 @@ Learn more about `res()` in [Response Query](../script/response/response-query) |------------|----------|-------| | `res.responseTime` | `lt` | `1000` | -## Available Operators +### JSON validation + +The `isJson` operator checks whether a value is a valid JSON object or array. + +| Expression | Operator | Result | +|------------|----------|--------| +| `res.body` | `isJson` | Passes if the response body is an object (`{}`) or an array (`[]`) | +| `res.body.data` | `isJson` | Passes if `data` is an object or array | + +## Available operators - **Comparison**: `equals`, `notEquals`, `gt`, `gte`, `lt`, `lte` - **String**: `contains`, `notContains`, `startsWith`, `endsWith`, `matches`, `notMatches`