From a52cd64469922ceb8e97da992370e16744c28f37 Mon Sep 17 00:00:00 2001 From: Vladimir Gorej Date: Mon, 6 Jul 2026 20:48:46 +0200 Subject: [PATCH] Clarify when Criterion `context` is required The `context` field said "If `type` is specified, then the `context` MUST be provided", which contradicts `type: simple`: a simple condition embeds its runtime expression directly in `condition` and has no separate context to apply anything to, yet an explicit `type: simple` would demand a `context`. Scope the requirement to the condition types that apply a pattern/query to a context (`regex`, `jsonpath`, `xpath`), matching the existing "For regex or JSONPath, the `type` and `context` MUST be specified" sentence and the Simple Condition example. --- src/arazzo.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/arazzo.md b/src/arazzo.md index 1520d08..b35e335 100644 --- a/src/arazzo.md +++ b/src/arazzo.md @@ -1062,7 +1062,7 @@ successCriteria: | Field Name | Type | Description | |--------------------------------------------|:-------------------------------------------------------------:|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| context | `{expression}` | A [Runtime Expression](#runtime-expressions) used to set the context for the condition to be applied on. If `type` is specified, then the `context` MUST be provided (e.g. `$response.body` would set the context that a JSONPath query expression could be applied to). | +| context | `{expression}` | A [Runtime Expression](#runtime-expressions) used to set the context for the condition to be applied on. If `type` is one of `regex`, `jsonpath`, or `xpath`, then `context` MUST be provided (e.g. `$response.body` sets the context that a JSONPath query expression could be applied to). | | condition | `string` | **REQUIRED**. The condition to apply. Conditions can be simple (e.g. `$statusCode == 200` which applies an operator on a value obtained from a runtime expression), or a regex, or a JSONPath expression. For regex or JSONPath, the `type` and `context` MUST be specified. | | type | `string` \| [Expression Type Object](#expression-type-object) | The type of condition to be applied. If specified, the options allowed are `simple`, `regex`, `jsonpath` or `xpath`. If omitted, then the condition is assumed to be `simple`, which at most combines literals, operators and [Runtime Expressions](#runtime-expressions). If `jsonpath`, then the expression MUST conform to [JSONPath](https://tools.ietf.org/html/rfc9535). If `xpath` the expression MUST conform to [XML Path Language 3.1](https://www.w3.org/TR/xpath-31/#d2e24229). Should other variants of JSONPath or XPath be required, then a [Expression Type Object](#expression-type-object) MUST be specified. |