Skip to content

Commit 9399043

Browse files
committed
Added support for AsyncAPI v3
Also cleaned up the spec to make it very clear that step-object can be oneOf openapi-step-object or asyncapi-step-object or workflow-step-object For AsyncAPI we really need support for timeout and dependOn. However, these are also useful for OpenAPI/Workflow steps so added it at the base step object. For OpenAPI we need at least one successCriteria but for AsyncAPI it can be optional.
1 parent 91e6d8c commit 9399043

File tree

1 file changed

+107
-18
lines changed

1 file changed

+107
-18
lines changed

src/schemas/validation/schema.yaml

Lines changed: 107 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ $defs:
7777
enum:
7878
- arazzo
7979
- openapi
80+
- asyncapi
8081
required:
8182
- name
8283
- url
@@ -152,7 +153,12 @@ $defs:
152153
$comment: https://spec.openapis.org/arazzo/v1.0#step-object'
153154
description: |-
154155
Describes a single workflow step which MAY be a call to an
155-
API operation (OpenAPI Operation Object or another Workflow Object)
156+
API operation (OpenAPI Operation Object or AsyncAPI Operation Object or another Workflow Object)
157+
oneOf:
158+
- $ref: '#/$defs/openapi-step-object'
159+
- $ref: '#/$defs/asyncapi-step-object'
160+
- $ref: '#/$defs/workflow-step-object'
161+
step-object-base:
156162
type: object
157163
properties:
158164
stepId:
@@ -165,12 +171,16 @@ $defs:
165171
operationId:
166172
description: The name of an existing, resolvable operation, as defined with a unique operationId and existing within one of the sourceDescriptions
167173
type: string
168-
operationPath:
169-
description: A reference to a Source combined with a JSON Pointer to reference an operation
170-
type: string
171-
workflowId:
172-
description: The workflowId referencing an existing workflow within the Arazzo description
173-
$ref: '#workflowId'
174+
timeout:
175+
description: The duration in milliseconds to wait before timing out the step
176+
type: integer
177+
dependsOn:
178+
description: Specifies a list of step identifiers that must complete (or be waited for) before the current step can begin execution
179+
type: array
180+
uniqueItems: true
181+
minItems: 1
182+
items:
183+
$ref: '#stepId'
174184
parameters:
175185
description: A list of parameters that MUST be passed to an operation or workflow as referenced by operationId, operationPath, or workflowId
176186
type: array
@@ -209,14 +219,21 @@ $defs:
209219
type: string
210220
required:
211221
- stepId
212-
oneOf:
213-
- required:
214-
- operationId
215-
- required:
216-
- operationPath
217-
- required:
218-
- workflowId
222+
openapi-step-object:
219223
allOf:
224+
- $ref: '#/$defs/step-object-base'
225+
- type: object
226+
properties:
227+
operationPath:
228+
description: A reference to a Source combined with a JSON Pointer to reference an operation
229+
type: string
230+
successCriteria:
231+
description: A list of assertions to determine the success of the step
232+
type: array
233+
uniqueItems: true
234+
minItems: 1
235+
items:
236+
$ref: '#/$defs/criterion-object'
220237
- if:
221238
oneOf:
222239
- required:
@@ -228,25 +245,96 @@ $defs:
228245
parameters:
229246
items:
230247
oneOf:
231-
- $ref: '#/$defs/reusable-object'
232248
- $ref: '#/$defs/parameter-object'
233249
required:
234250
- in
251+
- $ref: '#/$defs/reusable-object'
252+
- oneOf:
253+
- required:
254+
- operationId
255+
- required:
256+
- operationPath
257+
$ref: '#/$defs/specification-extensions'
258+
unevaluatedProperties: false
259+
asyncapi-step-object:
260+
allOf:
261+
- $ref: '#/$defs/step-object-base'
262+
- type: object
263+
properties:
264+
channelPath:
265+
description: A reference to a Source combined with a JSON Pointer to reference an async channel
266+
type: string
267+
correlationId:
268+
description: ID to correlate async responses with their requests, only specified for async receive steps
269+
type:
270+
- string
271+
- number
272+
- boolean
273+
- object
274+
- array
275+
action:
276+
description: Specifies the intended operation on the async channel, indicating whether the action is sending data to the channel or receiving data from the channel
277+
enum:
278+
- send
279+
- receive
280+
successCriteria:
281+
description: A list of assertions to determine the success of the step
282+
type: array
283+
uniqueItems: true
284+
minItems: 0
285+
items:
286+
$ref: '#/$defs/criterion-object'
287+
required:
288+
- action
235289
- if:
236-
required:
237-
- workflowId
290+
oneOf:
291+
- required:
292+
- operationId
293+
- required:
294+
- channelPath
238295
then:
239296
properties:
240297
parameters:
241298
items:
242299
oneOf:
243300
- $ref: '#/$defs/parameter-object'
301+
required:
302+
- in
244303
- $ref: '#/$defs/reusable-object'
304+
- if:
305+
required:
306+
- correlationId
307+
then:
308+
properties:
309+
action:
310+
const: receive
311+
required:
312+
- action
313+
- oneOf:
314+
- required:
315+
- operationId
316+
- required:
317+
- channelPath
245318
$ref: '#/$defs/specification-extensions'
246319
unevaluatedProperties: false
320+
workflow-step-object:
321+
allOf:
322+
- $ref: '#/$defs/step-object-base'
323+
- type: object
324+
properties:
325+
workflowId:
326+
description: The workflowId referencing an existing workflow within the Arazzo description
327+
$ref: '#workflowId'
328+
parameters:
329+
items:
330+
oneOf:
331+
- $ref: '#/$defs/parameter-object'
332+
- $ref: '#/$defs/reusable-object'
333+
required:
334+
- workflowId
247335
request-body-object:
248336
$comment: https://spec.openapis.org/arazzo/v1.0#request-body-object
249-
description: The request body to pass to an operation as referenced by operationId or operationPath
337+
description: The request body to pass to an operation as referenced by operationId or operationPath or channelPath
250338
type: object
251339
properties:
252340
contentType:
@@ -471,6 +559,7 @@ $defs:
471559
- query
472560
- header
473561
- cookie
562+
- channel
474563
value:
475564
description: The value to pass in the parameter
476565
type:

0 commit comments

Comments
 (0)