Skip to content

Commit

Permalink
Allow to send events with no data.
Browse files Browse the repository at this point in the history
  • Loading branch information
sjuarezgx committed Jul 20, 2023
1 parent 44b75a6 commit 306017d
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Text.Json;
Expand Down Expand Up @@ -279,8 +280,9 @@ private EventGridEvent ToEventGridSchema(GXEventGridSchema gxEventGridSchema, bo
private CloudEvent ToCloudEvent(GXCloudEvent gxCloudEvent, bool isBinaryData)
{
CloudEvent evt;
Dictionary<string, object> emptyData = new Dictionary<string, object>();
if (string.IsNullOrEmpty(gxCloudEvent.data))
evt = new CloudEvent(gxCloudEvent.source, gxCloudEvent.type, null);
evt = new CloudEvent(source:gxCloudEvent.source, type:gxCloudEvent.type, emptyData);
else
{
if (!isBinaryData)
Expand Down

0 comments on commit 306017d

Please sign in to comment.