Skip to content

Commit

Permalink
Merge pull request #877 from matthias-pichler-warrify/fix-usage-of-en…
Browse files Browse the repository at this point in the history
…dpoint-in-call-http

Fix usage of endpoint in-call http tasks
  • Loading branch information
ricardozanini authored Jun 3, 2024
2 parents cad3d64 + fe88421 commit a25f33c
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 12 deletions.
22 changes: 11 additions & 11 deletions dsl-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,14 @@ use:
call: http
with:
method: post
uri: https://fake.log.collector.com
endpoint: https://fake.log.collector.com
body:
message: "${ \"Executing task '\($task.reference)'...\" }"
after:
call: http
with:
method: post
uri: https://fake.log.collector.com
endpoint: https://fake.log.collector.com
body:
message: "${ \"Executed task '\($task.reference)'...\" }"
functions:
Expand Down Expand Up @@ -259,7 +259,7 @@ do:
call: http
with:
method: get
uri: https://petstore.swagger.io/v2/pet/{petId}
endpoint: https://petstore.swagger.io/v2/pet/{petId}
```
Serverless Workflow defines several default functions that **MUST** be supported by all implementations and runtimes:
Expand Down Expand Up @@ -371,7 +371,7 @@ do:
call: http
with:
method: get
uri: https://petstore.swagger.io/v2/pet/{petId}
endpoint: https://petstore.swagger.io/v2/pet/{petId}
```

##### OpenAPI Call
Expand Down Expand Up @@ -481,15 +481,15 @@ do:
call: http
with:
method: put
uri: https://fake-hospital.com/api/v3/alert/nurses
endpoint: https://fake-hospital.com/api/v3/alert/nurses
body:
patientId: ${ .patient.fullName }
room: ${ .room.number }
callDoctor:
call: http
with:
method: put
uri: https://fake-hospital.com/api/v3/alert/doctor
endpoint: https://fake-hospital.com/api/v3/alert/doctor
body:
patientId: ${ .patient.fullName }
room: ${ .room.number }
Expand Down Expand Up @@ -917,7 +917,7 @@ do:
call: http
with:
method: get
uri: https://
endpoint: https://
catch:
errors:
with:
Expand Down Expand Up @@ -1203,22 +1203,22 @@ use:
call: http
with:
method: post
uri: https://fake.log.collector.com
endpoint: https://fake.log.collector.com
body:
message: "${ \"Executing task '\($task.reference)'...\" }"
after:
call: http
with:
method: post
uri: https://fake.log.collector.com
endpoint: https://fake.log.collector.com
body:
message: "${ \"Executed task '\($task.reference)'...\" }"
do:
get:
call: http
with:
method: get
uri: https://fake.com/sample
endpoint: https://fake.com/sample
```

*Intercept HTTP calls to 'https://mocked.service.com' and mock its response:*
Expand Down Expand Up @@ -1247,7 +1247,7 @@ do:
call: http
with:
method: get
uri: https://fake.com/sample
endpoint: https://fake.com/sample
```

### Error
Expand Down
11 changes: 11 additions & 0 deletions examples/call-http-shorthand-endpoint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
document:
dsl: 1.0.0-alpha1
namespace: examples
name: call-http-shorthand-endpoint
version: 1.0.0-alpha1
do:
getPetById:
call: http
with:
method: get
endpoint: https://petstore.swagger.io/v2/pet/{petId}
5 changes: 4 additions & 1 deletion schema/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,11 @@ $defs:
type: string
description: The HTTP method of the HTTP request to perform.
endpoint:
$ref: '#/$defs/endpoint'
description: The HTTP endpoint to send the request to.
oneOf:
- $ref: '#/$defs/endpoint'
- type: string
format: uri-template
headers:
type: object
description: A name/value mapping of the headers, if any, of the HTTP request to perform.
Expand Down

0 comments on commit a25f33c

Please sign in to comment.