Skip to content

Commit

Permalink
Add correlation id in the header request-id in the 3.0 spec of order_…
Browse files Browse the repository at this point in the history
…service_async_v1.yaml
  • Loading branch information
yogeshnikam671 committed Dec 9, 2024
1 parent 92305c6 commit fa4265b
Showing 1 changed file with 23 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,20 @@ components:
name: OrderRequest
title: An order request
contentType: application/json
headers:
type: object
properties:
requestId:
type: string
description: Provide request id that you will use to identify the reply match
correlationId:
$ref: "#/components/correlationIds/orderCorrelationId"
payload:
$ref: '#/components/schemas/OrderRequest'
examples:
- name: NEW_ORDER
headers:
requestId: 1234
payload:
id: 12345
orderItems:
Expand All @@ -52,6 +62,14 @@ components:
name: OrderToProcess
title: An order that needs to be processed
contentType: application/json
headers:
type: object
properties:
requestId:
type: string
description: Reply message must contain correlation id of the request message
correlationId:
$ref: "#/components/correlationIds/orderCorrelationId"
payload:
type: object
required:
Expand All @@ -71,32 +89,11 @@ components:
- FAILED
examples:
- name: NEW_ORDER
headers:
requestId: 1234
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
Expand Down Expand Up @@ -128,3 +125,6 @@ components:
price:
type: number

correlationIds:
orderCorrelationId:
location: '$message.header#/requestId'

0 comments on commit fa4265b

Please sign in to comment.