From 293f461beb30e7c9ff0f5b6880382e29b091e503 Mon Sep 17 00:00:00 2001 From: Charles d'Avernas Date: Tue, 8 Oct 2024 15:03:29 +0200 Subject: [PATCH] =?UTF-8?q?fix(CoreApplicatio=C3=A7n):=20Fixed=20the=20Clo?= =?UTF-8?q?udEventRecordExtensions=20which=20was=20attempting=20to=20conve?= =?UTF-8?q?rt=20an=20array=20into=20an=20object?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Charles d'Avernas --- .../Extensions/CloudEventRecordExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/CloudStreams.Core.Application/Extensions/CloudEventRecordExtensions.cs b/src/core/CloudStreams.Core.Application/Extensions/CloudEventRecordExtensions.cs index 5226e77..cb51d2e 100644 --- a/src/core/CloudStreams.Core.Application/Extensions/CloudEventRecordExtensions.cs +++ b/src/core/CloudStreams.Core.Application/Extensions/CloudEventRecordExtensions.cs @@ -30,7 +30,7 @@ public static class CloudEventRecordExtensions public static CloudEvent ToCloudEvent(this CloudEventDescriptor descriptor) { ArgumentNullException.ThrowIfNull(descriptor); - var e = (JsonObject)JsonSerializer.Default.SerializeToNode(descriptor.Metadata.ContextAttributes.Where(a => a.Key.IsLowercased() && a.Key.IsAlphanumeric()))!; + var e = (JsonObject)JsonSerializer.Default.SerializeToNode(descriptor.Metadata.ContextAttributes.Where(a => a.Key.IsLowercased() && a.Key.IsAlphanumeric()).ToDictionary(kvp => kvp.Key, kvp => kvp.Value))!; var data = JsonSerializer.Default.SerializeToNode(descriptor.Data); e[CloudEventAttributes.Data] = data; return JsonSerializer.Default.Deserialize(e)!;