Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
arazzo: 1.1.0
info:
title: Async step cannot have both operationId and channelPath
version: 1.0.0
sourceDescriptions:
- name: eventAPI
url: https://events.com/asyncapi.yaml
type: asyncapi
workflows:
- workflowId: asyncWorkflow
steps:
- stepId: sendEvent
operationId: $sourceDescriptions.eventAPI.orderCreated
channelPath: orders
action: send
13 changes: 13 additions & 0 deletions tests/schema/fail/async-channelPath-without-action.arazzo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
arazzo: 1.1.0
info:
title: Async channelPath step MUST have an action
version: 1.0.0
sourceDescriptions:
- name: eventAPI
url: https://events.com/asyncapi.yaml
type: asyncapi
workflows:
- workflowId: asyncWorkflow
steps:
- stepId: receiveEvent
channelPath: orders
20 changes: 20 additions & 0 deletions tests/schema/fail/async-depends-on-duplicate-values.arazzo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
arazzo: 1.1.0
info:
title: Async dependsOn should contain unique values
version: 1.0.0
sourceDescriptions:
- name: eventAPI
url: https://events.com/asyncapi.yaml
type: asyncapi
workflows:
- workflowId: asyncWorkflow
steps:
- stepId: sendEvent
operationId: $sourceDescriptions.eventAPI.orderCreated
action: send
- stepId: receiveEvent
operationId: $sourceDescriptions.eventAPI.orderCreated
action: receive
dependsOn:
- sendEvent
- sendEvent
18 changes: 18 additions & 0 deletions tests/schema/fail/async-depends-on-empty.arazzo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
arazzo: 1.1.0
info:
title: Async dependsOn must not be empty
version: 1.0.0
sourceDescriptions:
- name: eventAPI
url: https://events.com/asyncapi.yaml
type: asyncapi
workflows:
- workflowId: asyncWorkflow
steps:
- stepId: sendEvent
operationId: $sourceDescriptions.eventAPI.orderCreated
action: send
- stepId: receiveEvent
operationId: $sourceDescriptions.eventAPI.orderCreated
action: receive
dependsOn: []
22 changes: 22 additions & 0 deletions tests/schema/fail/async-depends-on-invalid-reference.arazzo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
arazzo: 1.1.0
info:
title: Async dependsOn invalid reference shape
version: 1.0.0
sourceDescriptions:
- name: eventAPI
url: https://events.com/asyncapi.yaml
type: asyncapi
workflows:
- workflowId: asyncWorkflow
steps:
- stepId: sendEvent
operationId: $sourceDescriptions.eventAPI.orderCreated
action: send
- stepId: receiveEvent
operationId: $sourceDescriptions.eventAPI.orderCreated
action: receive
dependsOn:
# Invalid on purpose: dependsOn accepts a plain local stepId (`sendEvent`),
# `$workflows.<workflowId>.steps.<stepId>`, or
# `$sourceDescriptions.<name>.<workflowId>.steps.<stepId>`, but not `$steps.<stepId>`.
- $steps.sendEvent
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@frankkilcommins/ @nashjain
I remember there was a discussion about what context $step.STEP_ID refers to.
Would $workflows..steps. be equivalent to $steps. when referencing a step within the current workflow, or is there a difference in scope or resolution?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be the same, and the expectation is that evaluation would work similarly. When within the context of a workflow, $steps. refers to steps within the current workflow only. You could still use $worklows.<workflowId>.steps to get you to the same list assuming the is the current workflow.

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
arazzo: 1.1.0
info:
title: OpenAPI step cannot have both operationId and operationPath
version: 1.0.0
sourceDescriptions:
- name: userAPI
url: https://users.com/openapi.yaml
type: openapi
workflows:
- workflowId: openapiWorkflow
steps:
- stepId: getUsers
operationId: $sourceDescriptions.userAPI.listUsers
operationPath: $sourceDescriptions.userAPI#/paths/~1users/get
20 changes: 20 additions & 0 deletions tests/schema/fail/openapi-duplicate-parameters.arazzo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
arazzo: 1.1.0
info:
title: OpenAPI step parameters must be unique
version: 1.0.0
sourceDescriptions:
- name: userAPI
url: https://users.com/openapi.yaml
type: openapi
workflows:
- workflowId: openapiWorkflow
steps:
- stepId: getUsers
operationId: $sourceDescriptions.userAPI.listUsers
parameters:
- name: limit
in: query
value: 10
- name: limit
in: query
value: 10
12 changes: 12 additions & 0 deletions tests/schema/fail/openapi-missing-operation-target.arazzo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
arazzo: 1.1.0
info:
title: OpenAPI step must have an operation target
version: 1.0.0
sourceDescriptions:
- name: userAPI
url: https://users.com/openapi.yaml
type: openapi
workflows:
- workflowId: openapiWorkflow
steps:
- stepId: getUsers
27 changes: 27 additions & 0 deletions tests/schema/fail/workflow-duplicate-parameters.arazzo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
arazzo: 1.1.0
info:
title: Workflow step parameters must be unique
version: 1.0.0
sourceDescriptions:
- name: userAPI
url: https://users.com/openapi.yaml
type: openapi
workflows:
- workflowId: parentWorkflow
steps:
- stepId: nestedWorkflow
workflowId: childWorkflow
parameters:
- name: userId
value: 10
- name: userId
value: 10
- workflowId: childWorkflow
inputs:
type: object
properties:
userId:
type: integer
steps:
- stepId: childStep
operationId: $sourceDescriptions.userAPI.listUsers
16 changes: 16 additions & 0 deletions tests/schema/fail/workflow-missing-workflowId.arazzo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
arazzo: 1.1.0
info:
title: Workflow step must include workflowId
version: 1.0.0
sourceDescriptions:
- name: userAPI
url: https://users.com/openapi.yaml
type: openapi
workflows:
- workflowId: parentWorkflow
steps:
- stepId: nestedWorkflow
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check test name, it seems misleading, probably smth about empty step should be mentioned.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this test is actually about missing workflow id

- workflowId: childWorkflow
steps:
- stepId: childStep
operationId: $sourceDescriptions.userAPI.listUsers
18 changes: 18 additions & 0 deletions tests/schema/fail/workflow-step-with-action.arazzo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
arazzo: 1.1.0
info:
title: Workflow step cannot have async action
version: 1.0.0
sourceDescriptions:
- name: userAPI
url: https://users.com/openapi.yaml
type: openapi
workflows:
- workflowId: parentWorkflow
steps:
- stepId: nestedWorkflow
workflowId: childWorkflow
action: send
- workflowId: childWorkflow
steps:
- stepId: childStep
operationId: $sourceDescriptions.userAPI.listUsers
18 changes: 18 additions & 0 deletions tests/schema/fail/workflow-step-with-channelPath.arazzo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
arazzo: 1.1.0
info:
title: Workflow step cannot have channelPath
version: 1.0.0
sourceDescriptions:
- name: userAPI
url: https://users.com/openapi.yaml
type: openapi
workflows:
- workflowId: parentWorkflow
steps:
- stepId: nestedWorkflow
workflowId: childWorkflow
channelPath: orders
- workflowId: childWorkflow
steps:
- stepId: childStep
operationId: $sourceDescriptions.userAPI.listUsers
23 changes: 23 additions & 0 deletions tests/schema/pass/async-parameter-reusable-reference.arazzo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
arazzo: 1.1.0
info:
title: Async step parameter using reusable reference
version: 1.0.0
sourceDescriptions:
- name: eventAPI
url: https://events.com/asyncapi.yaml
type: asyncapi
components:
parameters:
correlationId:
name: correlationId
in: header
value: placeholder
workflows:
- workflowId: asyncWorkflow
steps:
- stepId: sendEvent
operationId: $sourceDescriptions.eventAPI.orderCreated
action: send
parameters:
- reference: $components.parameters.correlationId
value: abc123
14 changes: 14 additions & 0 deletions tests/schema/pass/async-receive-without-correlation-id.arazzo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
arazzo: 1.1.0
info:
title: Async receive step does not need a correlationId
version: 1.0.0
sourceDescriptions:
- name: eventAPI
url: https://events.com/asyncapi.yaml
type: asyncapi
workflows:
- workflowId: asyncWorkflow
steps:
- stepId: receiveEvent
operationId: $sourceDescriptions.eventAPI.orderCreated
action: receive
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
arazzo: 1.1.0
info:
title: Characterization of permissive channelPath string validation
version: 1.0.0
sourceDescriptions:
- name: eventAPI
url: https://events.com/asyncapi.yaml
type: asyncapi
workflows:
- workflowId: asyncWorkflow
steps:
# Characterization test: this passes today because channelPath is only
# validated as a string, not as a resolvable runtime-expression pointer.
- stepId: receiveEvent
channelPath: definitely-not-a-runtime-expression
action: receive
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
arazzo: 1.1.0
info:
title: Characterization of asyncapi operationId without action
version: 1.0.0
sourceDescriptions:
- name: eventAPI
url: https://events.com/asyncapi.yaml
type: asyncapi
workflows:
- workflowId: asyncWorkflow
steps:
# Characterization test: this passes today because the schema does not
# resolve sourceDescriptions.type when selecting the step-object branch.
- stepId: sendEvent
operationId: $sourceDescriptions.eventAPI.orderCreated
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
arazzo: 1.1.0
info:
title: Characterization of permissive operationPath string validation
version: 1.0.0
sourceDescriptions:
- name: userAPI
url: https://users.com/openapi.yaml
type: openapi
workflows:
- workflowId: openapiWorkflow
steps:
# Characterization test: this passes today because operationPath is only
# validated as a string, not as a resolvable runtime-expression pointer.
- stepId: getUsers
operationPath: definitely-not-a-runtime-expression
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
arazzo: 1.1.0
info:
title: Characterization of openapi operationId with async action
version: 1.0.0
sourceDescriptions:
- name: userAPI
url: https://users.com/openapi.yaml
type: openapi
workflows:
- workflowId: openapiWorkflow
steps:
# Characterization test: this passes today because action makes the step
# match the async branch without checking the source type.
- stepId: getUsers
operationId: $sourceDescriptions.userAPI.listUsers
action: send
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
arazzo: 1.1.0
info:
title: Characterization of openapi receive step with correlationId
version: 1.0.0
sourceDescriptions:
- name: userAPI
url: https://users.com/openapi.yaml
type: openapi
workflows:
- workflowId: openapiWorkflow
steps:
# Characterization test: this passes today because the schema validates
# receive/correlation fields structurally without resolving source type.
- stepId: getUsers
operationId: $sourceDescriptions.userAPI.listUsers
action: receive
correlationId: request-123
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
arazzo: 1.1.0
info:
title: Characterization of workflow step with requestBody
version: 1.0.0
sourceDescriptions:
- name: userAPI
url: https://users.com/openapi.yaml
type: openapi
workflows:
- workflowId: parentWorkflow
steps:
# Characterization test: this passes today because requestBody is defined
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like this test is false positive and don't really check anything except the lack of possible verification. Do we need to have it still?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

toady workflow steps can contain requestBody, but ideally they should not.

# on step-object-base, so workflow steps currently accept it structurally.
# This was done to keep backward compatibility.
- stepId: nestedWorkflow
workflowId: childWorkflow
requestBody:
contentType: application/json
payload:
userId: 10
- workflowId: childWorkflow
steps:
- stepId: childStep
operationId: $sourceDescriptions.userAPI.listUsers
13 changes: 13 additions & 0 deletions tests/schema/pass/openapi-operation-path.arazzo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
arazzo: 1.1.0
info:
title: OpenAPI step with operationPath
version: 1.0.0
sourceDescriptions:
- name: userAPI
url: https://users.com/openapi.yaml
type: openapi
workflows:
- workflowId: openapiWorkflow
steps:
- stepId: getUsers
operationPath: $sourceDescriptions.userAPI#/paths/~1users/get
Loading
Loading