Skip to content

Commit 9be3ccf

Browse files
authoredJan 10, 2025
[eg] make req/optional more explicit in readme (#32079)
* update * update for clarity
1 parent 483f464 commit 9be3ccf

File tree

1 file changed

+6
-3
lines changed
  • specification/eventgrid/Azure.Messaging.EventGrid.SystemEvents

1 file changed

+6
-3
lines changed
 

‎specification/eventgrid/Azure.Messaging.EventGrid.SystemEvents/README.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,18 @@ In order to automate the mapping of event definition with event type, please fol
1313

1414
Under the `Azure.Messaging.EventGrid.SystemEvents` folder find or create your service's `.tsp` file. This is where you will add your new event. For help with typespec conventions refer to [this doc](https://microsoft.github.io/typespec/) about typespec basics. Each new event will be represented as a typespec `model`. After you create your new event, in the `client.tsp` file, you need to add `@@usage(EventGrid.YourEventName, Usage.output)` and `@@access(EventGrid.YourEventName, Access.public)`.
1515

16-
A sample valid event definition is shown below:
16+
A sample valid event definition is shown below with `required` and `optional` properties:
1717
~~~ markdown
1818

1919
/** Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageReceived event. */
2020
model AcsChatMessageReceivedEventData {
2121
...AcsChatMessageEventBaseProperties;
2222

23-
/** The body of the chat message. */
24-
messageBody : string;
23+
/** Required. Field is always present in the event. */
24+
requiredProperty : string;
25+
26+
/** Optional. Field may not be present in some events. */
27+
optionalProperty ?: string;
2528
}
2629
~~~
2730

0 commit comments

Comments
 (0)