Skip to content

Commit a80c808

Browse files
committed
Added an example and fixed both schema and dsl
Signed-off-by: Charles d'Avernas <[email protected]>
1 parent 1d73ede commit a80c808

File tree

3 files changed

+52
-6
lines changed

3 files changed

+52
-6
lines changed

dsl-reference.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ The [AsyncAPI Call](#asyncapi-call) enables workflows to interact with external
277277
| Name | Type | Required | Description|
278278
|:--|:---:|:---:|:---|
279279
| document | [`externalResource`](#external-resource) | `yes` | The AsyncAPI document that defines the operation to call. |
280-
| operation | `string` | `yes` | The id of the AsyncAPI operation to call. |
280+
| operationRef | `string` | `yes` | A reference to the AsyncAPI operation to call. |
281281
| server | `string` | `no` | A reference to the server to call the specified AsyncAPI operation on.<br>If not set, default to the first server matching the operation's channel. |
282282
| message | `string` | `no` | The name of the message to use. <br>If not set, defaults to the first message defined by the operation. |
283283
| binding | `string` | `no` | The name of the binding to use. <br>If not set, defaults to the first binding defined by the operation |
@@ -382,7 +382,7 @@ The [OpenAPI Call](#openapi-call) enables workflows to interact with external se
382382
| Name | Type | Required | Description|
383383
|:--|:---:|:---:|:---|
384384
| document | [`externalResource`](#external-resource) | `yes` | The OpenAPI document that defines the operation to call. |
385-
| operation | `string` | `yes` | The id of the OpenAPI operation to call. |
385+
| operationId | `string` | `yes` | The id of the OpenAPI operation to call. |
386386
| arguments | `map` | `no` | A name/value mapping of the parameters, if any, of the OpenAPI operation to call. |
387387
| authentication | [`authentication`](#authentication) | `no` | The authentication policy, or the name of the authentication policy, to use when calling the OpenAPI operation. |
388388
| output | `string` | `no` | The OpenAPI call's output format.<br>*Supported values are:*<br>*- `raw`, which output's the base-64 encoded [http response](#http-response) content, if any.*<br>*- `content`, which outputs the content of [http response](#http-response), possibly deserialized.*<br>*- `response`, which outputs the [http response](#http-response).*<br>*Defaults to `content`.* |
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
document:
2+
dsl: 1.0.0-alpha1
3+
namespace: examples
4+
name: accumulate-room-readings
5+
version: 1.0.0-alpha1
6+
do:
7+
consumeReading:
8+
listen:
9+
to:
10+
all:
11+
- with:
12+
source: https://my.home.com/sensor
13+
type: my.home.sensors.temperature
14+
correlate:
15+
roomId:
16+
from: .roomid
17+
output:
18+
from: .data.reading
19+
- with:
20+
source: https://my.home.com/sensor
21+
type: my.home.sensors.humidity
22+
correlate:
23+
roomId:
24+
from: .roomid
25+
output:
26+
from: .data.reading
27+
as: readings
28+
logReading:
29+
for:
30+
each: reading
31+
in: .readings
32+
do:
33+
call: openapi
34+
with:
35+
document:
36+
uri: http://myorg.io/ordersservices.json
37+
operationId: logreading
38+
generateReport:
39+
call: openapi
40+
with:
41+
document:
42+
uri: http://myorg.io/ordersservices.json
43+
operationId: produceReport
44+
timeout:
45+
after:
46+
hours: 1

schema/workflow.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ $defs:
140140
document:
141141
$ref: '#/$defs/externalResource'
142142
description: The document that defines the AsyncAPI operation to call.
143-
operation:
143+
operationRef:
144144
type: string
145145
description: A reference to the AsyncAPI operation to call.
146146
server:
@@ -158,7 +158,7 @@ $defs:
158158
authentication:
159159
ref: '#/$defs/authenticationPolicy'
160160
description: The authentication policy, if any, to use when calling the AsyncAPI operation.
161-
required: [ document, operation ]
161+
required: [ document, operationRef ]
162162
description: Defines the AsyncAPI call to perform.
163163
required: [ call, with ]
164164
- properties:
@@ -235,7 +235,7 @@ $defs:
235235
document:
236236
$ref: '#/$defs/externalResource'
237237
description: The document that defines the OpenAPI operation to call.
238-
operation:
238+
operationId:
239239
type: string
240240
description: The id of the OpenAPI operation to call.
241241
parameters:
@@ -249,7 +249,7 @@ $defs:
249249
type: string
250250
enum: [ raw, content, response ]
251251
description: The http call output format. Defaults to 'content'.
252-
required: [ document, operation ]
252+
required: [ document, operationId ]
253253
description: Defines the OpenAPI call to perform.
254254
required: [ call, with ]
255255
- properties:

0 commit comments

Comments
 (0)