Skip to content

Commit a25f33c

Browse files
Merge pull request #877 from matthias-pichler-warrify/fix-usage-of-endpoint-in-call-http
Fix usage of endpoint in-call http tasks
2 parents cad3d64 + fe88421 commit a25f33c

File tree

3 files changed

+26
-12
lines changed

3 files changed

+26
-12
lines changed

dsl-reference.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -149,14 +149,14 @@ use:
149149
call: http
150150
with:
151151
method: post
152-
uri: https://fake.log.collector.com
152+
endpoint: https://fake.log.collector.com
153153
body:
154154
message: "${ \"Executing task '\($task.reference)'...\" }"
155155
after:
156156
call: http
157157
with:
158158
method: post
159-
uri: https://fake.log.collector.com
159+
endpoint: https://fake.log.collector.com
160160
body:
161161
message: "${ \"Executed task '\($task.reference)'...\" }"
162162
functions:
@@ -259,7 +259,7 @@ do:
259259
call: http
260260
with:
261261
method: get
262-
uri: https://petstore.swagger.io/v2/pet/{petId}
262+
endpoint: https://petstore.swagger.io/v2/pet/{petId}
263263
```
264264
265265
Serverless Workflow defines several default functions that **MUST** be supported by all implementations and runtimes:
@@ -371,7 +371,7 @@ do:
371371
call: http
372372
with:
373373
method: get
374-
uri: https://petstore.swagger.io/v2/pet/{petId}
374+
endpoint: https://petstore.swagger.io/v2/pet/{petId}
375375
```
376376

377377
##### OpenAPI Call
@@ -481,15 +481,15 @@ do:
481481
call: http
482482
with:
483483
method: put
484-
uri: https://fake-hospital.com/api/v3/alert/nurses
484+
endpoint: https://fake-hospital.com/api/v3/alert/nurses
485485
body:
486486
patientId: ${ .patient.fullName }
487487
room: ${ .room.number }
488488
callDoctor:
489489
call: http
490490
with:
491491
method: put
492-
uri: https://fake-hospital.com/api/v3/alert/doctor
492+
endpoint: https://fake-hospital.com/api/v3/alert/doctor
493493
body:
494494
patientId: ${ .patient.fullName }
495495
room: ${ .room.number }
@@ -917,7 +917,7 @@ do:
917917
call: http
918918
with:
919919
method: get
920-
uri: https://
920+
endpoint: https://
921921
catch:
922922
errors:
923923
with:
@@ -1203,22 +1203,22 @@ use:
12031203
call: http
12041204
with:
12051205
method: post
1206-
uri: https://fake.log.collector.com
1206+
endpoint: https://fake.log.collector.com
12071207
body:
12081208
message: "${ \"Executing task '\($task.reference)'...\" }"
12091209
after:
12101210
call: http
12111211
with:
12121212
method: post
1213-
uri: https://fake.log.collector.com
1213+
endpoint: https://fake.log.collector.com
12141214
body:
12151215
message: "${ \"Executed task '\($task.reference)'...\" }"
12161216
do:
12171217
get:
12181218
call: http
12191219
with:
12201220
method: get
1221-
uri: https://fake.com/sample
1221+
endpoint: https://fake.com/sample
12221222
```
12231223

12241224
*Intercept HTTP calls to 'https://mocked.service.com' and mock its response:*
@@ -1247,7 +1247,7 @@ do:
12471247
call: http
12481248
with:
12491249
method: get
1250-
uri: https://fake.com/sample
1250+
endpoint: https://fake.com/sample
12511251
```
12521252

12531253
### Error
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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+
getPetById:
8+
call: http
9+
with:
10+
method: get
11+
endpoint: https://petstore.swagger.io/v2/pet/{petId}

schema/workflow.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,11 @@ $defs:
215215
type: string
216216
description: The HTTP method of the HTTP request to perform.
217217
endpoint:
218-
$ref: '#/$defs/endpoint'
219218
description: The HTTP endpoint to send the request to.
219+
oneOf:
220+
- $ref: '#/$defs/endpoint'
221+
- type: string
222+
format: uri-template
220223
headers:
221224
type: object
222225
description: A name/value mapping of the headers, if any, of the HTTP request to perform.

0 commit comments

Comments
 (0)