From e7da821dc30260130f6f7f8cbd42f0cdf9fbfb61 Mon Sep 17 00:00:00 2001 From: Ricardo Zanini Date: Wed, 5 Feb 2025 11:32:19 -0500 Subject: [PATCH 1/2] Fix #1076 - Make detail and title a runtime expression in the schema Signed-off-by: Ricardo Zanini --- dsl-reference.md | 6 +++--- schema/workflow.yaml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dsl-reference.md b/dsl-reference.md index 01172417..e7534dfa 100644 --- a/dsl-reference.md +++ b/dsl-reference.md @@ -1115,7 +1115,7 @@ Defines the configuration of a catch clause, which a concept used to catch error | Name | Type | Required | Description | |:--|:---:|:---:|:---| -| errors | [`errorFilter`](#retry) | `no` | The definition of the errors to catch. | +| errors | [`errorFilter`](#error) | `no` | The definition of the errors to catch. | | as | `string` | `no` | The name of the runtime expression variable to save the error as. Defaults to 'error'. | | when | `string`| `no` | A runtime expression used to determine whether or not to catch the filtered error. | | exceptWhen | `string` | `no` | A runtime expression used to determine whether or not to catch the filtered error. | @@ -1958,8 +1958,8 @@ Defines the [Problem Details RFC](https://datatracker.ietf.org/doc/html/rfc7807) | type | [`uri-template`](#uri-template) | `yes` | A URI reference that identifies the [`error`](#error) type.
For cross-compatibility concerns, it is strongly recommended to use [Standard Error Types](#standard-error-types) whenever possible.
Runtimes **MUST** ensure that the property has been set when raising or escalating the [`error`](#error). | | status | `integer` | `yes` | The status code generated by the origin for this occurrence of the [`error`](#error).
For cross-compatibility concerns, it is strongly recommended to use [HTTP Status Codes](https://datatracker.ietf.org/doc/html/rfc7231#section-6) whenever possible.
Runtimes **MUST** ensure that the property has been set when raising or escalating the [`error`](#error). | | instance | `string` | `no` | A [JSON Pointer](https://datatracker.ietf.org/doc/html/rfc6901) used to reference the component the [`error`](#error) originates from.
Runtimes **MUST** set the property when raising or escalating the [`error`](#error). Otherwise ignore. | -| title | `string` | `no` | A short, human-readable summary of the [`error`](#error). | -| detail | `string` | `no` | A human-readable explanation specific to this occurrence of the [`error`](#error). | +| title | `string` | `no` | A short, human-readable summary of the [`error`](#error) or a [runtime expression](dsl.md#runtime-expressions) | +| detail | `string` | `no` | A human-readable explanation specific to this occurrence of the [`error`](#error) or a [runtime expression](dsl.md#runtime-expressions) | #### Examples diff --git a/schema/workflow.yaml b/schema/workflow.yaml index b59e2f3a..5ae7207f 100644 --- a/schema/workflow.yaml +++ b/schema/workflow.yaml @@ -1188,11 +1188,11 @@ $defs: title: ExpressionErrorInstance description: An expression based error instance. title: - type: string + $ref: '#/$defs/runtimeExpression' title: ErrorTitle description: A short, human-readable summary of the error. detail: - type: string + $ref: '#/$defs/runtimeExpression' title: ErrorDetails description: A human-readable explanation specific to this occurrence of the error. required: [ type, status ] From b0172b8d9d85b44411f3921a0fd563dfd9ac577c Mon Sep 17 00:00:00 2001 From: Ricardo Zanini Date: Wed, 5 Feb 2025 11:46:53 -0500 Subject: [PATCH 2/2] Add string as anyOf Signed-off-by: Ricardo Zanini --- schema/workflow.yaml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/schema/workflow.yaml b/schema/workflow.yaml index 5ae7207f..70804f16 100644 --- a/schema/workflow.yaml +++ b/schema/workflow.yaml @@ -1188,13 +1188,21 @@ $defs: title: ExpressionErrorInstance description: An expression based error instance. title: - $ref: '#/$defs/runtimeExpression' - title: ErrorTitle description: A short, human-readable summary of the error. + title: ErrorTitle + anyOf: + - $ref: '#/$defs/runtimeExpression' + title: ExpressionErrorTitle + - type: string + title: LiteralErrorTitle detail: - $ref: '#/$defs/runtimeExpression' title: ErrorDetails description: A human-readable explanation specific to this occurrence of the error. + anyOf: + - $ref: '#/$defs/runtimeExpression' + title: ExpressionErrorDetails + - type: string + title: LiteralErrorDetails required: [ type, status ] errorFilter: type: object