diff --git a/examples/asyncapi.yaml b/examples/asyncapi.yaml new file mode 100644 index 00000000..9d442d08 --- /dev/null +++ b/examples/asyncapi.yaml @@ -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 } diff --git a/examples/use-authentication.yaml b/examples/use-authentication.yaml new file mode 100644 index 00000000..c8cd34fe --- /dev/null +++ b/examples/use-authentication.yaml @@ -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 diff --git a/schema/workflow.yaml b/schema/workflow.yaml index f8d9c90d..eeef3dd7 100644 --- a/schema/workflow.yaml +++ b/schema/workflow.yaml @@ -133,7 +133,7 @@ $defs: - properties: call: type: string - constant: asyncapi + const: asyncapi with: type: object properties: @@ -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: @@ -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 @@ -203,7 +207,7 @@ $defs: - properties: call: type: string - constant: http + const: http with: type: object properties: @@ -228,7 +232,7 @@ $defs: - properties: call: type: string - constant: openapi + const: openapi with: type: object properties: @@ -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 ] @@ -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 @@ -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 @@ -332,6 +340,7 @@ $defs: default: continue - type: string forTask: + type: object properties: for: type: object @@ -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 @@ -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.