Decorators
TypeSpec.Events
@contentType
Specifies the content type of the event envelope, event body, or event payload.
When applied to an event payload, that field must also have a corresponding @data
decorator.
Target
UnionVariant | ModelProperty
Parameters
Name | Type | Description |
---|---|---|
contentType | valueof string |
Examples
Specify the content type of the event payload.
@data
Identifies the payload of an event. Only one field in an event can be marked as the payload.
Target
ModelProperty
Parameters
None
Examples
@events
Specify that this union describes a set of events.
Target
Union
Parameters
None