Skip to content

Commit cad3d64

Browse files
Merge pull request #876 from matthias-pichler-warrify/fix-schema
Fix workflow schema: change `const`, adding missing `object`; etc.
2 parents 2ac27be + aeba879 commit cad3d64

File tree

3 files changed

+60
-9
lines changed

3 files changed

+60
-9
lines changed

examples/asyncapi.yaml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
document:
2+
dsl: 1.0.0-alpha1
3+
namespace: examples
4+
name: bearer-auth
5+
version: 1.0.0-alpha1
6+
do:
7+
greetUser:
8+
call: asyncapi
9+
with:
10+
document:
11+
uri: https://fake.com/docs/asyncapi.json
12+
operationRef: findPetsByStatus
13+
server: staging
14+
message: getPetByStatusQuery
15+
binding: http
16+
payload:
17+
petId: ${ .pet.id }
18+
authentication:
19+
bearer:
20+
token: ${ .token }

examples/use-authentication.yaml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
document:
2+
dsl: 1.0.0-alpha1
3+
namespace: examples
4+
name: bearer-auth
5+
version: 1.0.0-alpha1
6+
use:
7+
authentications:
8+
petStoreAuth:
9+
bearer:
10+
token: ${ .token }
11+
do:
12+
getPetById:
13+
call: http
14+
with:
15+
method: get
16+
endpoint:
17+
uri: https://petstore.swagger.io/v2/pet/{petId}
18+
authentication: petStoreAuth

schema/workflow.yaml

+22-9
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ $defs:
133133
- properties:
134134
call:
135135
type: string
136-
constant: asyncapi
136+
const: asyncapi
137137
with:
138138
type: object
139139
properties:
@@ -156,15 +156,17 @@ $defs:
156156
type: object
157157
description: The payload to call the AsyncAPI operation with, if any.
158158
authentication:
159-
ref: '#/$defs/authenticationPolicy'
160159
description: The authentication policy, if any, to use when calling the AsyncAPI operation.
160+
oneOf:
161+
- $ref: '#/$defs/authenticationPolicy'
162+
- type: string
161163
required: [ document, operationRef ]
162164
description: Defines the AsyncAPI call to perform.
163165
required: [ call, with ]
164166
- properties:
165167
call:
166168
type: string
167-
constant: grpc
169+
const: grpc
168170
with:
169171
type: object
170172
properties:
@@ -187,8 +189,10 @@ $defs:
187189
max: 65535
188190
description: The port number of the GRPC service to call.
189191
authentication:
190-
$ref: '#/$defs/authenticationPolicy'
191192
description: The endpoint's authentication policy, if any.
193+
oneOf:
194+
- $ref: '#/$defs/authenticationPolicy'
195+
- type: string
192196
required: [ name, host ]
193197
method:
194198
type: string
@@ -203,7 +207,7 @@ $defs:
203207
- properties:
204208
call:
205209
type: string
206-
constant: http
210+
const: http
207211
with:
208212
type: object
209213
properties:
@@ -228,7 +232,7 @@ $defs:
228232
- properties:
229233
call:
230234
type: string
231-
constant: openapi
235+
const: openapi
232236
with:
233237
type: object
234238
properties:
@@ -243,8 +247,10 @@ $defs:
243247
additionalProperties: true
244248
description: A name/value mapping of the parameters of the OpenAPI operation to call.
245249
authentication:
246-
$ref: '#/$defs/authenticationPolicy'
247250
description: The authentication policy, if any, to use when calling the OpenAPI operation.
251+
oneOf:
252+
- $ref: '#/$defs/authenticationPolicy'
253+
- type: string
248254
output:
249255
type: string
250256
enum: [ raw, content, response ]
@@ -264,6 +270,7 @@ $defs:
264270
description: A name/value mapping of the parameters, if any, to call the function with.
265271
required: [ call ]
266272
compositeTask:
273+
type: object
267274
properties:
268275
execute:
269276
type: object
@@ -291,6 +298,7 @@ $defs:
291298
required: [ execute ]
292299
description: Serves as a pivotal orchestrator within workflow systems, enabling the seamless integration and execution of multiple subtasks to accomplish complex operations
293300
emitTask:
301+
type: object
294302
properties:
295303
emit:
296304
type: object
@@ -332,6 +340,7 @@ $defs:
332340
default: continue
333341
- type: string
334342
forTask:
343+
type: object
335344
properties:
336345
for:
337346
type: object
@@ -668,8 +677,10 @@ $defs:
668677
format: uri-template
669678
description: The endpoint's URI.
670679
authentication:
671-
$ref: '#/$defs/authenticationPolicy'
672680
description: The authentication policy to use.
681+
oneOf:
682+
- $ref: '#/$defs/authenticationPolicy'
683+
- type: string
673684
required: [ uri ]
674685
eventConsumptionStrategy:
675686
type: object
@@ -761,8 +772,10 @@ $defs:
761772
format: uri
762773
description: The endpoint's URI.
763774
authentication:
764-
$ref: '#/$defs/authenticationPolicy'
765775
description: The authentication policy to use.
776+
oneOf:
777+
- $ref: '#/$defs/authenticationPolicy'
778+
- type: string
766779
name:
767780
type: string
768781
description: The external resource's name, if any.

0 commit comments

Comments
 (0)