-
Notifications
You must be signed in to change notification settings - Fork 62
feat: added support for AsyncAPI v3 #367
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
Open
nashjain
wants to merge
5
commits into
OAI:v1.1-dev
Choose a base branch
from
specmatic:dev
base: v1.1-dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+667
−177
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
4235d97
Added support for AsyncAPI v3
nashjain 37a5151
Update arazzo.md file with AsyncAPI related changes along with a samp…
nashjain 37d911f
fix: update operationId and correlationId references in arazzo.md AND…
nashjain 75d1cb0
fix: enhance dependsOn description in schema.yaml and arazzo.md, and …
nashjain ff01227
fix: update stepId in examples
nashjain File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| asyncapi: 3.0.0 | ||
|
|
||
| info: | ||
| title: Simple Pet Purchase API | ||
| version: "1.0.0" | ||
|
|
||
| servers: | ||
| localKafka: | ||
| host: localhost:9092 | ||
| protocol: kafka | ||
|
|
||
| channels: | ||
| place-order: | ||
| address: place-order | ||
| messages: | ||
| placeOrder.message: | ||
| $ref: "#/components/messages/OrderRequest" | ||
|
|
||
| confirm-order: | ||
| address: confirm-order | ||
| messages: | ||
| confirmOrder.message: | ||
| $ref: "#/components/messages/OrderResponse" | ||
|
|
||
| operations: | ||
| placeOrder: | ||
| description: Place an order | ||
| action: receive | ||
| channel: | ||
| $ref: "#/channels/place-order" | ||
| messages: | ||
| - $ref: "#/channels/place-order/messages/placeOrder.message" | ||
| reply: | ||
| channel: | ||
| $ref: "#/channels/confirm-order" | ||
| messages: | ||
| - $ref: "#/channels/confirm-order/messages/confirmOrder.message" | ||
|
|
||
| components: | ||
| messages: | ||
| OrderRequest: | ||
| contentType: application/json | ||
| correlationId: | ||
| description: Identifier that correlates this request with a response | ||
| location: "$message.header#/orderRequestId" | ||
| headers: | ||
| type: object | ||
| required: | ||
| - orderRequestId | ||
| properties: | ||
| orderRequestId: | ||
| type: string | ||
| description: Unique ID for tracking the order flow | ||
| payload: | ||
| type: object | ||
| required: | ||
| - petId | ||
| properties: | ||
| petId: | ||
| type: integer | ||
|
|
||
| OrderResponse: | ||
| contentType: application/json | ||
| correlationId: | ||
| description: Identifier that correlates this response with a request | ||
| location: "$message.header#/orderRequestId" | ||
| headers: | ||
| type: object | ||
| required: | ||
| - orderRequestId | ||
| properties: | ||
| orderRequestId: | ||
| type: string | ||
| description: Unique ID for tracking the order flow | ||
| payload: | ||
| type: object | ||
| required: | ||
| - orderId | ||
| properties: | ||
| orderId: | ||
| type: integer |
13 changes: 13 additions & 0 deletions
13
tests/schema/fail/channel-path-is-invalid-for-openapi.arazzo.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| arazzo: 1.1.0 | ||
| info: | ||
| title: Minimal Arazzo Example for AsyncAPI | ||
| version: 1.0.0 | ||
| sourceDescriptions: | ||
| - name: exampleAPI | ||
| url: https://example.com/openapi.yaml | ||
| type: openapi | ||
| workflows: | ||
| - workflowId: basicWorkflow | ||
| steps: | ||
| - stepId: step1 | ||
| channelPath: createUser |
15 changes: 15 additions & 0 deletions
15
tests/schema/fail/invalid-async-correlation-id-non-receive-action.arazzo.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| arazzo: 1.1.0 | ||
| info: | ||
| title: Minimal Arazzo Example for AsyncAPI | ||
| version: 1.0.0 | ||
| sourceDescriptions: | ||
| - name: exampleAPI | ||
| url: https://example.com/asyncapi.yaml | ||
| type: asyncapi | ||
| workflows: | ||
| - workflowId: basicWorkflow | ||
| steps: | ||
| - stepId: step1 | ||
| operationId: createUser | ||
| action: send | ||
| correlationId: invalid |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| arazzo: 1.1.0 | ||
| info: | ||
| title: Minimal Arazzo Example for AsyncAPI | ||
| version: 1.0.0 | ||
| sourceDescriptions: | ||
| - name: exampleAPI | ||
| url: https://example.com/asyncapi.yaml | ||
| type: asyncapi | ||
| workflows: | ||
| - workflowId: basicWorkflow | ||
| steps: | ||
| - stepId: step1 | ||
| operationId: createUser | ||
| action: invalid |
15 changes: 15 additions & 0 deletions
15
tests/schema/pass/async-correlation-id-for-receive-action.arazzo.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| arazzo: 1.1.0 | ||
| info: | ||
| title: Minimal Arazzo Example for AsyncAPI with Correlation ID for Receive Action | ||
| version: 1.0.0 | ||
| sourceDescriptions: | ||
| - name: exampleAPI | ||
| url: https://example.com/asyncapi.yaml | ||
| type: asyncapi | ||
| workflows: | ||
| - workflowId: basicWorkflow | ||
| steps: | ||
| - stepId: step1 | ||
| operationId: createUser | ||
| action: receive | ||
| correlationId: id123 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Could you please clarify, why step mentioned in dependsOn can't be synchronous?
Steps referred by dependsOn SHOULD be non-blocking/async steps.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.
Like can async Step depend on Sync step results?
Uh oh!
There was an error while loading. Please reload this page.
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.
Technically the spec does not stop you. But the intent is for a step (sync or async) to use the output of an asynchronous step. Hence we've used the language around SHOULD and not MUST.
With an async step, once you invoke it, you would move forward, as it is a non-blocking call. However, with a sync step, since it is blocking, you would anyway need to wait for it to complete.
Is there a use case you've in mind for which you want to depend on a sync step?
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.
I’m wondering in what case we would need to make the dependency explicit. It seems redundant to me, since each step has to be executed (including setting the outputs) before we proceed to another step. Otherwise it will create the possibility to execute steps in different order (e.g., set the dependency to a next step).
Also, what does '... step identifiers that must complete (or be waited for)'? actually mean? How do we determine that an async step has completed? What exactly are we waiting for?