-
Notifications
You must be signed in to change notification settings - Fork 64
Add missing schema validation fixtures for async, OpenAPI, and workflow steps #476
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
dc569e6
9de1625
2f0b01e
620ec8c
eeced55
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 |
| 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 |
| 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 |
| 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: [] |
| 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 | ||
| 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 |
| 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 |
| 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 |
| 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 |
| 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 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
| 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 |
| 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 |
| 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 |
| 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 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
| 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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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>.stepsto get you to the same list assuming the is the current workflow.