-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add order_service_async_v1.yaml 3.0.0 specification
- Loading branch information
1 parent
1738865
commit 92305c6
Showing
1 changed file
with
130 additions
and
0 deletions.
There are no files selected for viewing
130 changes: 130 additions & 0 deletions
130
io/specmatic/examples/store/asyncapi/3_0_0/order_service_async_v1.yaml
This file contains 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,130 @@ | ||
asyncapi: 3.0.0 | ||
info: | ||
title: Order API | ||
version: '1.0.0' | ||
|
||
channels: | ||
place-order: | ||
messages: | ||
placeOrderMessage: | ||
$ref: "#/components/messages/OrderRequest" | ||
|
||
process-order: | ||
messages: | ||
processOrderMessage: | ||
$ref: "#/components/messages/Order" | ||
|
||
operations: | ||
onPlaceOrder: | ||
action: receive | ||
channel: | ||
$ref: '#/channels/place-order' | ||
messages: | ||
- $ref: "#/channels/place-order/messages/placeOrderMessage" | ||
reply: | ||
channel: | ||
$ref: '#/channels/process-order' | ||
messages: | ||
- $ref: '#/channels/process-order/messages/processOrderMessage' | ||
|
||
components: | ||
messages: | ||
OrderRequest: | ||
name: OrderRequest | ||
title: An order request | ||
contentType: application/json | ||
payload: | ||
$ref: '#/components/schemas/OrderRequest' | ||
examples: | ||
- name: NEW_ORDER | ||
payload: | ||
id: 12345 | ||
orderItems: | ||
- id: 1 | ||
name: "Macbook" | ||
quantity: 1 | ||
price: 2000.00 | ||
- id: 2 | ||
name: "Iphone" | ||
quantity: 1 | ||
price: 1000.00 | ||
Order: | ||
name: OrderToProcess | ||
title: An order that needs to be processed | ||
contentType: application/json | ||
payload: | ||
type: object | ||
required: | ||
- totalAmount | ||
- status | ||
properties: | ||
orderRequestId: | ||
type: integer | ||
totalAmount: | ||
type: number | ||
status: | ||
type: string | ||
enum: | ||
- NEW | ||
- IN_PROGRESS | ||
- PROCESSED | ||
- FAILED | ||
examples: | ||
- name: NEW_ORDER | ||
payload: | ||
totalAmount: 3000.00 | ||
status: "PROCESSED" | ||
Notification: | ||
name: Notification | ||
title: A notification message | ||
contentType: application/json | ||
payload: | ||
type: object | ||
required: | ||
- message | ||
- type | ||
properties: | ||
message: | ||
type: string | ||
type: | ||
type: string | ||
enum: | ||
- ORDER_PLACED | ||
- ORDER_PROCESSED | ||
|
||
examples: | ||
- name: NEW_ORDER | ||
payload: | ||
message: "Order processed successfully" | ||
type: "ORDER_PLACED" | ||
schemas: | ||
OrderRequest: | ||
type: object | ||
required: | ||
- id | ||
- orderItems | ||
properties: | ||
id: | ||
description: Unique identifier of the order request | ||
type: number | ||
orderItems: | ||
type: array | ||
items: | ||
$ref: '#/components/schemas/OrderItem' | ||
OrderItem: | ||
type: object | ||
required: | ||
- id | ||
- name | ||
- quantity | ||
- price | ||
properties: | ||
id: | ||
type: integer | ||
name: | ||
type: string | ||
quantity: | ||
type: integer | ||
price: | ||
type: number | ||
|