Send EventGrid spec #12958
Labels
Client
This issue points to a problem in the data-plane of the library.
Event Grid
Messaging
Messaging crew
Milestone
After a lot of investigation and discussion with all party involved, drafting a spec for
send
of EventGrid. We might be near to be done with @t-swpill work, but for clarity needs to be written:We shall have ONE
send
method only, that accepts different types of content:For the later, we shall send the dict "as-is" on the wire, and not try any kind of client-side validation. Example, this is a valid way to send a Cloud Event:
The dict follow the CloudEvent spec, so there is no reason to not send it that way.
Implementation (important) detail: when sending a CloudEvent, we must set the Content-Type to "application/cloudevents-batch+json; charset=utf-8". This means in the dict case, we must detect if the dict is Cloud Event. We recommend using a predicate that checks:
If the dict follow this structure, we send the JSON with
application/cloudevents-batch+json; charset=utf-8
, otherwise we useapplication/json
In case we want to be explicit:
And list are supported:
CC @KieranBrantnerMagee @rakshith91
The text was updated successfully, but these errors were encountered: