Skip to content

Commit

Permalink
Merge branch 'main' into super-lint
Browse files Browse the repository at this point in the history
  • Loading branch information
matthias-pichler authored Jun 3, 2024
2 parents 51c95b9 + a25f33c commit 3083ead
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 21 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 @@ -483,15 +483,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 @@ -918,7 +918,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 @@ -1248,7 +1248,7 @@ do:
call: http
with:
method: get
uri: https://fake.com/sample
endpoint: https://fake.com/sample
```

### Error
Expand Down
20 changes: 20 additions & 0 deletions examples/asyncapi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
document:
dsl: 1.0.0-alpha1
namespace: examples
name: bearer-auth
version: 1.0.0-alpha1
do:
greetUser:
call: asyncapi
with:
document:
uri: https://fake.com/docs/asyncapi.json
operationRef: findPetsByStatus
server: staging
message: getPetByStatusQuery
binding: http
payload:
petId: ${ .pet.id }
authentication:
bearer:
token: ${ .token }
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}
18 changes: 18 additions & 0 deletions examples/use-authentication.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
document:
dsl: 1.0.0-alpha1
namespace: examples
name: bearer-auth
version: 1.0.0-alpha1
use:
authentications:
petStoreAuth:
bearer:
token: ${ .token }
do:
getPetById:
call: http
with:
method: get
endpoint:
uri: https://petstore.swagger.io/v2/pet/{petId}
authentication: petStoreAuth
36 changes: 26 additions & 10 deletions schema/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ $defs:
- properties:
call:
type: string
constant: asyncapi
const: asyncapi
with:
type: object
properties:
Expand Down Expand Up @@ -173,17 +173,19 @@ $defs:
description: |
The payload to call the AsyncAPI operation with, if any.
authentication:
ref: "#/$defs/authenticationPolicy"
description: |
The authentication policy, if any, to use when calling the
AsyncAPI operation.
oneOf:
- $ref: "#/$defs/authenticationPolicy"
- type: string
required: [document, operationRef]
description: Defines the AsyncAPI call to perform.
required: [call, with]
- properties:
call:
type: string
constant: grpc
const: grpc
with:
type: object
properties:
Expand All @@ -207,7 +209,9 @@ $defs:
max: 65535
description: The port number of the GRPC service to call.
authentication:
$ref: "#/$defs/authenticationPolicy"
oneOf:
- $ref: "#/$defs/authenticationPolicy"
- type: string
description: The endpoint's authentication policy, if any.
required: [name, host]
method:
Expand All @@ -224,16 +228,19 @@ $defs:
- properties:
call:
type: string
constant: http
const: http
with:
type: object
properties:
method:
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: |
Expand All @@ -251,7 +258,7 @@ $defs:
- properties:
call:
type: string
constant: openapi
const: openapi
with:
type: object
properties:
Expand All @@ -269,7 +276,9 @@ $defs:
A name/value mapping of the parameters of the OpenAPI
operation to call.
authentication:
$ref: "#/$defs/authenticationPolicy"
oneOf:
- $ref: "#/$defs/authenticationPolicy"
- type: string
description: |
The authentication policy, if any, to use when calling the
OpenAPI operation.
Expand All @@ -294,6 +303,7 @@ $defs:
function with.
required: [call]
compositeTask:
type: object
properties:
execute:
type: object
Expand Down Expand Up @@ -331,6 +341,7 @@ $defs:
seamless integration and execution of multiple subtasks to accomplish
complex operations
emitTask:
type: object
properties:
emit:
type: object
Expand Down Expand Up @@ -380,6 +391,7 @@ $defs:
default: continue
- type: string
forTask:
type: object
properties:
for:
type: object
Expand Down Expand Up @@ -787,8 +799,10 @@ $defs:
format: uri-template
description: The endpoint's URI.
authentication:
$ref: "#/$defs/authenticationPolicy"
description: The authentication policy to use.
oneOf:
- $ref: "#/$defs/authenticationPolicy"
- type: string
required: [uri]
eventConsumptionStrategy:
type: object
Expand Down Expand Up @@ -916,8 +930,10 @@ $defs:
format: uri
description: The endpoint's URI.
authentication:
$ref: "#/$defs/authenticationPolicy"
description: The authentication policy to use.
oneOf:
- $ref: "#/$defs/authenticationPolicy"
- type: string
name:
type: string
description: The external resource's name, if any.
Expand Down

0 comments on commit 3083ead

Please sign in to comment.