Skip to content

Commit

Permalink
Merge pull request #876 from matthias-pichler-warrify/fix-schema
Browse files Browse the repository at this point in the history
Fix workflow schema: change `const`, adding missing `object`; etc.
  • Loading branch information
ricardozanini authored Jun 3, 2024
2 parents 2ac27be + aeba879 commit cad3d64
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 9 deletions.
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 }
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
31 changes: 22 additions & 9 deletions schema/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ $defs:
- properties:
call:
type: string
constant: asyncapi
const: asyncapi
with:
type: object
properties:
Expand All @@ -156,15 +156,17 @@ $defs:
type: object
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 @@ -187,8 +189,10 @@ $defs:
max: 65535
description: The port number of the GRPC service to call.
authentication:
$ref: '#/$defs/authenticationPolicy'
description: The endpoint's authentication policy, if any.
oneOf:
- $ref: '#/$defs/authenticationPolicy'
- type: string
required: [ name, host ]
method:
type: string
Expand All @@ -203,7 +207,7 @@ $defs:
- properties:
call:
type: string
constant: http
const: http
with:
type: object
properties:
Expand All @@ -228,7 +232,7 @@ $defs:
- properties:
call:
type: string
constant: openapi
const: openapi
with:
type: object
properties:
Expand All @@ -243,8 +247,10 @@ $defs:
additionalProperties: true
description: A name/value mapping of the parameters of the OpenAPI operation to call.
authentication:
$ref: '#/$defs/authenticationPolicy'
description: The authentication policy, if any, to use when calling the OpenAPI operation.
oneOf:
- $ref: '#/$defs/authenticationPolicy'
- type: string
output:
type: string
enum: [ raw, content, response ]
Expand All @@ -264,6 +270,7 @@ $defs:
description: A name/value mapping of the parameters, if any, to call the function with.
required: [ call ]
compositeTask:
type: object
properties:
execute:
type: object
Expand Down Expand Up @@ -291,6 +298,7 @@ $defs:
required: [ execute ]
description: Serves as a pivotal orchestrator within workflow systems, enabling the seamless integration and execution of multiple subtasks to accomplish complex operations
emitTask:
type: object
properties:
emit:
type: object
Expand Down Expand Up @@ -332,6 +340,7 @@ $defs:
default: continue
- type: string
forTask:
type: object
properties:
for:
type: object
Expand Down Expand Up @@ -668,8 +677,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 @@ -761,8 +772,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 cad3d64

Please sign in to comment.