Skip to content

Commit 4eafeeb

Browse files
dimastbkclaude
andauthored
Fix further dsl-reference.md / schema/workflow.yaml mismatches (#1161)
Follow-up to the mismatches reported in #1156: Doc alignments (dsl-reference.md): - Add the required `namespace` property to the Run -> Workflow Process table. - Remove the spurious `extension` value from the extension `extend` enum (there is no "extension" task type). - Mark AsyncAPI `channel`/`operation` as optional; they are mutually alternative depending on the AsyncAPI version, not both required. - Document catch `errors.with` as the static error filter, matching the schema and examples. - Lowercase the Duration property names (days, hours, ...) to match the schema keys. - Document the `pullPolicy` enum values (ifNotPresent, always, never). - Change `issuers` from `uri-template[]` to `string[]` to match the schema and RFC 7519 (StringOrURI). Script language token (js): - Standardize the script language token on `js` (as used by the Java SDK), replacing `javascript` in dsl-reference.md, dsl.md and the example. Schema (schema/workflow.yaml): - Rename the errorFilter `details` property to `detail`, matching the `error` definition and RFC 7807. - Require `authority` and `grant` for inline OAuth2/OIDC authentication (oauth2AuthenticationProperties); `grant_type` is REQUIRED per RFC 6749 and neither field has a default. Signed-off-by: Dmitriy <dimastbk@proton.me> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 0fa90c0 commit 4eafeeb

4 files changed

Lines changed: 24 additions & 19 deletions

File tree

dsl-reference.md

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -332,14 +332,17 @@ The [AsyncAPI Call](#asyncapi-call) enables workflows to interact with external
332332
| Name | Type | Required | Description |
333333
|:-----|:----:|:--------:|:------------|
334334
| document | [`externalResource`](#external-resource) | `yes` | The AsyncAPI document that defines the [operation](https://www.asyncapi.com/docs/reference/specification/v3.0.0#operationObject) to call. |
335-
| channel | `string` | `yes` | The name of the channel on which to perform the operation. The operation to perform is defined by declaring either `message`, in which case the [channel](https://v2.asyncapi.com/docs/reference/specification/v2.6.0#channelItemObject)'s `publish` operation will be executed, or `subscription`, in which case the [channel](https://v2.asyncapi.com/docs/reference/specification/v2.6.0#channelItemObject)'s `subscribe` operation will be executed.<br>*Used only in case the referenced document uses AsyncAPI `v2.6.0`.* |
336-
| operation | `string` | `yes` | A reference to the AsyncAPI [operation](https://www.asyncapi.com/docs/reference/specification/v3.0.0#operationObject) to call.<br>*Used only in case the referenced document uses AsyncAPI `v3.0.0`.* |
335+
| channel | `string` | `no` | The name of the channel on which to perform the operation. The operation to perform is defined by declaring either `message`, in which case the [channel](https://v2.asyncapi.com/docs/reference/specification/v2.6.0#channelItemObject)'s `publish` operation will be executed, or `subscription`, in which case the [channel](https://v2.asyncapi.com/docs/reference/specification/v2.6.0#channelItemObject)'s `subscribe` operation will be executed.<br>*Used only in case the referenced document uses AsyncAPI `v2.6.0`.* |
336+
| operation | `string` | `no` | A reference to the AsyncAPI [operation](https://www.asyncapi.com/docs/reference/specification/v3.0.0#operationObject) to call.<br>*Used only in case the referenced document uses AsyncAPI `v3.0.0`.* |
337337
| server | [`asyncApiServer`](#asyncapi-server) | `no` | An object used to configure to the [server](https://www.asyncapi.com/docs/reference/specification/v3.0.0#serverObject) to call the specified AsyncAPI [operation](https://www.asyncapi.com/docs/reference/specification/v3.0.0#operationObject) on.<br>If not set, default to the first [server](https://www.asyncapi.com/docs/reference/specification/v3.0.0#serverObject) matching the operation's channel. |
338338
| protocol | `string` | `no` | The [protocol](https://www.asyncapi.com/docs/reference/specification/v3.0.0#definitionsProtocol) to use to select the target [server](https://www.asyncapi.com/docs/reference/specification/v3.0.0#serverObject). <br>Ignored if `server` has been set.<br>*Supported values are: `amqp`, `amqp1`, `anypointmq`, `googlepubsub`, `http`, `ibmmq`, `jms`, `kafka`, `mercure`, `mqtt`, `mqtt5`, `nats`, `pulsar`, `redis`, `sns`, `solace`, `sqs`, `stomp` and `ws`* |
339339
| message | [`asyncApiMessage`](#asyncapi-outbound-message) | `no` | An object used to configure the message to publish using the target operation.<br>*Required if `subscription` has not been set.* |
340340
| subscription | [`asyncApiSubscription`](#asyncapi-subscription) | `no` | An object used to configure the subscription to messages consumed using the target operation.<br>*Required if `message` has not been set.* |
341341
| authentication | `string`<br>[`authentication`](#authentication) | `no` | The authentication policy, or the name of the authentication policy, to use when calling the AsyncAPI operation. |
342342

343+
> [!NOTE]
344+
> Exactly one of `channel` (AsyncAPI `v2.6.0`) or `operation` (AsyncAPI `v3.0.0`) **must** be set, paired with exactly one of `message` or `subscription`.
345+
343346
###### Examples
344347

345348
```yaml
@@ -895,7 +898,7 @@ do:
895898
- runScript:
896899
run:
897900
script:
898-
language: javascript
901+
language: js
899902
code: >
900903
Some cool multiline script
901904
@@ -930,7 +933,7 @@ Enables the execution of external processes encapsulated within a containerized
930933
| stdin | `string` | `no` | A runtime expression, if any, passed as standard input to the command or default container CMD|
931934
| arguments | `string[]` | `no` | A list of the arguments, if any, passed as argv to the command or default container CMD |
932935
| lifetime | [`containerLifetime`](#container-lifetime) | `no` | An object used to configure the container's lifetime. |
933-
| pullPolicy | `string` | `no` | Policy that controls how the container's image should be pulled from the registry. Defaults to `ifNotPresent` |
936+
| pullPolicy | `string` | `no` | Policy that controls how the container's image should be pulled from the registry.<br>*Supported values are `ifNotPresent`, `always` and `never`.*<br>*Defaults to `ifNotPresent`.* |
934937

935938
###### Examples
936939

@@ -1003,7 +1006,7 @@ do:
10031006
- runScript:
10041007
run:
10051008
script:
1006-
language: javascript
1009+
language: js
10071010
arguments:
10081011
- hello
10091012
- world
@@ -1060,6 +1063,7 @@ Enables the invocation and execution of nested workflows within a parent workflo
10601063

10611064
| Name | Type | Required | Description |
10621065
|:--|:---:|:---:|:---|
1066+
| namespace | `string` | `yes` | The namespace the workflow to run belongs to. |
10631067
| name | `string` | `yes` | The name of the workflow to run |
10641068
| version | `string` | `yes` | The version of the workflow to run. Defaults to `latest` |
10651069
| input | `any` | `no` | The data, if any, to pass as input to the workflow to execute. The value should be validated against the target workflow's input schema, if specified |
@@ -1245,7 +1249,7 @@ Defines the configuration of a catch clause, which a concept used to catch error
12451249

12461250
| Name | Type | Required | Description |
12471251
|:--|:---:|:---:|:---|
1248-
| errors | [`errorFilter`](#error) | `no` | The definition of the errors to catch. |
1252+
| errors.with | [`errorFilter`](#error) | `no` | A static filter, used to catch only the errors whose properties match the specified values. |
12491253
| as | `string` | `no` | The name of the runtime expression variable to save the error as. Defaults to 'error'. |
12501254
| when | `string`| `no` | A runtime expression used to determine whether or not to catch the filtered error. |
12511255
| exceptWhen | `string` | `no` | A runtime expression used to determine whether or not to catch the filtered error. |
@@ -1857,7 +1861,7 @@ Defines the fundamentals of an 'oauth2' authentication.
18571861
| client.assertion | `string` | `no` | A JWT containing a signed assertion with your application credentials.<br>Required when `client.authentication` has been set to `private_key_jwt`. |
18581862
| client.authentication | `string` | `no` | The client authentication method to use.<br>Supported values are `client_secret_basic`, `client_secret_post`, `client_secret_jwt`, `private_key_jwt` or `none`.<br>Defaults to `client_secret_post`. |
18591863
| request.encoding | `string` | `no` | The encoding of the token request.<br>Supported values are `application/x-www-form-urlencoded` and `application/json`.<br>Defaults to application/x-www-form-urlencoded. |
1860-
| issuers | `uri-template[]` | `no` | A list that contains that contains valid issuers that will be used to check against the issuer of generated tokens. |
1864+
| issuers | `string[]` | `no` | A list that contains valid issuers that will be used to check against the issuer of generated tokens. |
18611865
| scopes | `string[]` | `no` | The scopes, if any, to request the token for. |
18621866
| audiences | `string[]` | `no` | The audiences, if any, to request the token for. |
18631867
| username | `string` | `no` | The username to use. Used only if the grant type is `Password`. |
@@ -1919,7 +1923,7 @@ Defines the fundamentals of an 'oidc' authentication.
19191923
| client.assertion | `string` | `no` | A JWT containing a signed assertion with your application credentials.<br>Required when `client.authentication` has been set to `private_key_jwt`. |
19201924
| client.authentication | `string` | `no` | The client authentication method to use.<br>Supported values are `client_secret_basic`, `client_secret_post`, `client_secret_jwt`, `private_key_jwt` or `none`.<br>Defaults to `client_secret_post`. |
19211925
| request.encoding | `string` | `no` | The encoding of the token request.<br>Supported values are `application/x-www-form-urlencoded` and `application/json`.<br>Defaults to application/x-www-form-urlencoded. |
1922-
| issuers | `uri-template[]` | `no` | A list that contains that contains valid issuers that will be used to check against the issuer of generated tokens. |
1926+
| issuers | `string[]` | `no` | A list that contains valid issuers that will be used to check against the issuer of generated tokens. |
19231927
| scopes | `string[]` | `no` | The scopes, if any, to request the token for. |
19241928
| audiences | `string[]` | `no` | The audiences, if any, to request the token for. |
19251929
| username | `string` | `no` | The username to use. Used only if the grant type is `Password`. |
@@ -2001,7 +2005,7 @@ Extensions enable the execution of tasks prior to those they extend, offering th
20012005

20022006
| Property | Type | Required | Description |
20032007
|----------|:----:|:--------:|-------------|
2004-
| extend | `string` | `yes` | The type of task to extend<br>Supported values are: `call`, `composite`, `emit`, `extension`, `for`, `listen`, `raise`, `run`, `set`, `switch`, `try`, `wait` and `all` |
2008+
| extend | `string` | `yes` | The type of task to extend<br>Supported values are: `call`, `composite`, `emit`, `for`, `listen`, `raise`, `run`, `set`, `switch`, `try`, `wait` and `all` |
20052009
| when | `string` | `no` | A runtime expression used to determine whether or not the extension should apply in the specified context |
20062010
| before | [`task[]`](#task) | `no` | The list of tasks to execute, if any, before the extended task |
20072011
| after | [`task[]`](#task) | `no` | The list of tasks to execute, if any, after the extended task |
@@ -2384,11 +2388,11 @@ Defines a duration. Durations can be defined through properties, with an ISO 860
23842388

23852389
| Property | Type | Required | Description |
23862390
|----------|:----:|:--------:|-------------|
2387-
| Days | `integer` | `no` | Number of days, if any. |
2388-
| Hours | `integer` | `no` | Number of hours, if any. |
2389-
| Minutes | `integer` | `no`| Number of minutes, if any. |
2390-
| Seconds | `integer` | `no`| Number of seconds, if any. |
2391-
| Milliseconds | `integer` | `no`| Number of milliseconds, if any. |
2391+
| days | `integer` | `no` | Number of days, if any. |
2392+
| hours | `integer` | `no` | Number of hours, if any. |
2393+
| minutes | `integer` | `no`| Number of minutes, if any. |
2394+
| seconds | `integer` | `no`| Number of seconds, if any. |
2395+
| milliseconds | `integer` | `no`| Number of milliseconds, if any. |
23922396

23932397
#### Examples
23942398

@@ -2523,7 +2527,7 @@ do:
25232527
- runScript:
25242528
run:
25252529
script:
2526-
language: javascript
2530+
language: js
25272531
code: >
25282532
Some cool multiline script
25292533
return: code

dsl.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ output:
640640
description: A boolean indicating whether or not the email address is valid.
641641
run:
642642
script:
643-
language: javascript
643+
language: js
644644
code: |
645645
function validateEmail(email) {
646646
const re = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$/;

examples/run-script-with-stdin-and-arguments.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ do:
77
- runScript:
88
run:
99
script:
10-
language: javascript
10+
language: js
1111
stdin: "Hello Workflow"
1212
environment:
1313
foo: bar

schema/workflow.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,6 +1238,7 @@ $defs:
12381238
type: object
12391239
title: OAuth2AuthenticationData
12401240
description: Inline configuration of the OAuth2 authentication policy.
1241+
required: [ authority, grant ]
12411242
properties:
12421243
authority:
12431244
$ref: '#/$defs/uriTemplate'
@@ -1429,10 +1430,10 @@ $defs:
14291430
instance:
14301431
type: string
14311432
description: if present, means this value should be used for filtering
1432-
title:
1433+
title:
14331434
type: string
14341435
description: if present, means this value should be used for filtering
1435-
details:
1436+
detail:
14361437
type: string
14371438
description: if present, means this value should be used for filtering
14381439
uriTemplate:

0 commit comments

Comments
 (0)