Skip to content

Commit 7926b00

Browse files
Update eg guidance (resending PR to to main branch) (#15644)
* Update readme.md * Update readme.md Co-authored-by: Laurent Mazuel <[email protected]>
1 parent 77f5d3b commit 7926b00

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

specification/eventgrid/data-plane/readme.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,51 @@ A sample valid event definition is shown below:
3838
```
3939
~~~
4040

41+
In addition to the event schema definition, you must provide a JSON example of a real event the service can trigger. This example must be in a "examples" folder close to your JSON, and called using snakeCase based on the event final name. The example should contain the envelope, but could be CloudEvent or EventGrid schema, whatever is easier. Example should NOT be handcrafted, but an actual result from a server test environment like canary (it's not required that the event is deployed in production yet). No PR will be accepted without the example.
42+
43+
For the previous schema, the example file should be called "chat_message_received.json" and contains:
44+
~~~ markdown
45+
```json
46+
{
47+
"id": "02272459-badb-4e2e-b538-4cb8a2f71da6",
48+
"topic": "/subscriptions/{subscription-id}/resourceGroups/{group-name}/providers/Microsoft.Communication/communicationServices/{communication-services-resource-name}",
49+
"subject": "thread/{thread-id}/sender/{rawId}/recipient/{rawId}",
50+
"data": {
51+
"messageBody": "Welcome to Azure Communication Services",
52+
"messageId": "1613694358927",
53+
"metadata": {
54+
"key": "value",
55+
"description": "A map of data associated with the message"
56+
},
57+
"senderId": "8:acs:109f0644-b956-4cd9-87b1-71024f6e2f44_00000008-578d-7caf-07fd-084822001724",
58+
"senderCommunicationIdentifier": {
59+
"rawId": "8:acs:109f0644-b956-4cd9-87b1-71024f6e2f44_00000008-578d-7caf-07fd-084822001724",
60+
"communicationUser": {
61+
"id": "8:acs:109f0644-b956-4cd9-87b1-71024f6e2f44_00000008-578d-7caf-07fd-084822001724"
62+
}
63+
},
64+
"senderDisplayName": "Jhon",
65+
"composeTime": "2021-02-19T00:25:58.927Z",
66+
"type": "Text",
67+
"version": 1613694358927,
68+
"recipientId": "8:acs:109f0644-b956-4cd9-87b1-71024f6e2f44_00000008-578d-7d05-83fe-084822000f6d",
69+
"recipientCommunicationIdentifier": {
70+
"rawId": "8:acs:109f0644-b956-4cd9-87b1-71024f6e2f44_00000008-578d-7d05-83fe-084822000f6d",
71+
"communicationUser": {
72+
"id": "8:acs:109f0644-b956-4cd9-87b1-71024f6e2f44_00000008-578d-7d05-83fe-084822000f6d"
73+
}
74+
},
75+
"transactionId": "oh+LGB2dUUadMcTAdRWQxQ.1.1.1.1.1827536918.1.7",
76+
"threadId": "19:[email protected]"
77+
},
78+
"eventType": "Microsoft.Communication.ChatMessageReceived",
79+
"dataVersion": "1.0",
80+
"metadataVersion": "1",
81+
"eventTime": "2021-02-19T00:25:59.9436666Z"
82+
}
83+
```
84+
~~~
85+
4186
---
4287
## Getting Started
4388
To build the SDK for EventGrid, simply [Install AutoRest](https://aka.ms/autorest/install) and in this folder, run:

0 commit comments

Comments
 (0)