Skip to content

Commit f3b1419

Browse files
chore: update examples
1 parent de4356e commit f3b1419

9 files changed

+102
-99
lines changed

examples/accumulate-room-readings.yaml

Lines changed: 34 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -4,43 +4,44 @@ document:
44
name: accumulate-room-readings
55
version: 1.0.0-alpha1
66
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:
7+
sequentially:
8+
- consumeReading:
9+
listen:
10+
to:
11+
all:
12+
- with:
13+
source: https://my.home.com/sensor
14+
type: my.home.sensors.temperature
15+
correlate:
16+
roomId:
17+
from: .roomid
18+
output:
19+
from: .data.reading
20+
- with:
21+
source: https://my.home.com/sensor
22+
type: my.home.sensors.humidity
23+
correlate:
24+
roomId:
25+
from: .roomid
26+
output:
27+
from: .data.reading
28+
as: readings
29+
- logReading:
30+
for:
31+
each: reading
32+
in: .readings
33+
do:
34+
call: openapi
35+
with:
36+
document:
37+
uri: http://myorg.io/ordersservices.json
38+
operationId: logreading
39+
- generateReport:
3340
call: openapi
3441
with:
3542
document:
3643
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+
operationId: produceReport
4445
timeout:
4546
after:
4647
hours: 1

examples/asyncapi.yaml

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,16 @@ document:
44
name: bearer-auth
55
version: 1.0.0-alpha1
66
do:
7-
- greetUser:
8-
call: asyncapi
9-
with:
10-
document:
11-
uri: https://fake.com/docs/asyncapi.json
12-
operationRef: findPetsByStatus
13-
server: staging
14-
message: getPetByStatusQuery
15-
binding: http
16-
payload:
17-
petId: ${ .pet.id }
18-
authentication:
19-
bearer:
20-
token: ${ .token }
7+
call: asyncapi
8+
with:
9+
document:
10+
uri: https://fake.com/docs/asyncapi.json
11+
operationRef: findPetsByStatus
12+
server: staging
13+
message: getPetByStatusQuery
14+
binding: http
15+
payload:
16+
petId: ${ .pet.id }
17+
authentication:
18+
bearer:
19+
token: ${ .token }

examples/bearer-auth-uri-format.yaml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@ document:
44
name: bearer-auth-uri-format
55
version: 1.0.0-alpha1
66
do:
7-
- getPetById:
8-
call: http
9-
with:
10-
method: get
11-
endpoint:
12-
uri: https://petstore.swagger.io/v2/pet/1
13-
authentication:
14-
bearer:
15-
token: ${ .token }
7+
call: http
8+
with:
9+
method: get
10+
endpoint:
11+
uri: https://petstore.swagger.io/v2/pet/1
12+
authentication:
13+
bearer:
14+
token: ${ .token }

examples/bearer-auth.yaml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@ document:
44
name: bearer-auth
55
version: 1.0.0-alpha1
66
do:
7-
- getPetById:
8-
call: http
9-
with:
10-
method: get
11-
endpoint:
12-
uri: https://petstore.swagger.io/v2/pet/{petId}
13-
authentication:
14-
bearer:
15-
token: ${ .token }
7+
call: http
8+
with:
9+
method: get
10+
endpoint:
11+
uri: https://petstore.swagger.io/v2/pet/{petId}
12+
authentication:
13+
bearer:
14+
token: ${ .token }

examples/call-http-shorthand-endpoint.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ document:
44
name: call-http-shorthand-endpoint
55
version: 1.0.0-alpha1
66
do:
7-
- getPetById:
8-
call: http
9-
with:
10-
method: get
11-
endpoint: https://petstore.swagger.io/v2/pet/{petId}
7+
call: http
8+
with:
9+
method: get
10+
endpoint: https://petstore.swagger.io/v2/pet/{petId}

examples/do-single.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
document:
2+
dsl: 1.0.0-alpha1
3+
namespace: examples
4+
name: call-http-shorthand-endpoint
5+
version: 1.0.0-alpha1
6+
do:
7+
call: http
8+
with:
9+
method: get
10+
endpoint: https://petstore.swagger.io/v2/pet/{petId}

examples/mock-service-extension.yaml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ use:
1818
bar: baz
1919
then: exit #using this, we indicate to the workflow we want to exit the extended task, thus just returning what we injected
2020
do:
21-
- get:
22-
call: http
23-
with:
24-
method: get
25-
endpoint:
26-
uri: https://fake.com/sample
21+
call: http
22+
with:
23+
method: get
24+
endpoint:
25+
uri: https://fake.com/sample

examples/switch-then-string.yaml

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ document:
44
name: sample-workflow
55
version: '0.1.0'
66
do:
7-
- processOrder:
8-
switch:
9-
- case1:
10-
when: .orderType == "electronic"
11-
then: processElectronicOrder
12-
- case2:
13-
when: .orderType == "physical"
14-
then: processPhysicalOrder
15-
- default:
16-
then: handleUnknownOrderType
17-
- processElectronicOrder:
18-
execute:
7+
sequentially:
8+
- processOrder:
9+
switch:
10+
- case1:
11+
when: .orderType == "electronic"
12+
then: processElectronicOrder
13+
- case2:
14+
when: .orderType == "physical"
15+
then: processPhysicalOrder
16+
- default:
17+
then: handleUnknownOrderType
18+
- processElectronicOrder:
1919
sequentially:
2020
- validatePayment:
2121
set:
@@ -24,8 +24,7 @@ do:
2424
set:
2525
status: fulfilled
2626
then: exit
27-
- processPhysicalOrder:
28-
execute:
27+
- processPhysicalOrder:
2928
sequentially:
3029
- checkInventory:
3130
set:
@@ -37,8 +36,7 @@ do:
3736
set:
3837
address: Elmer St
3938
then: exit
40-
- handleUnknownOrderType:
41-
execute:
39+
- handleUnknownOrderType:
4240
sequentially:
4341
- logWarning:
4442
set:

examples/use-authentication.yaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@ use:
99
bearer:
1010
token: ${ .token }
1111
do:
12-
- getPetById:
13-
call: http
14-
with:
15-
method: get
16-
endpoint:
17-
uri: https://petstore.swagger.io/v2/pet/{petId}
18-
authentication: petStoreAuth
12+
call: http
13+
with:
14+
method: get
15+
endpoint:
16+
uri: https://petstore.swagger.io/v2/pet/{petId}
17+
authentication: petStoreAuth

0 commit comments

Comments
 (0)