From 8923c7dc573a3dd974d5ef4f289e4042861b9d5d Mon Sep 17 00:00:00 2001 From: "Stuart Blackler (@im5tu)" Date: Mon, 8 Jun 2026 21:11:37 +0100 Subject: [PATCH] fix(apigw): register HttpMethod in logging serialization context Microsoft.Extensions.Http logs the HttpRequestMessage method when an outbound HttpClient request starts. The value reaches the JSON logger as a boxed HttpMethod, and DictionaryJsonConverter threw because the ApiGateway LoggingSerializationContext had no type info for it, causing 'An error occurred while writing to logger(s)'. Register HttpMethod, mirroring the Core logging context. --- .../Goa.Functions.ApiGateway/LoggingSerializationContext.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Functions/Goa.Functions.ApiGateway/LoggingSerializationContext.cs b/src/Functions/Goa.Functions.ApiGateway/LoggingSerializationContext.cs index 504dadee..6706ec2f 100644 --- a/src/Functions/Goa.Functions.ApiGateway/LoggingSerializationContext.cs +++ b/src/Functions/Goa.Functions.ApiGateway/LoggingSerializationContext.cs @@ -1,5 +1,6 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Routing; +using System.Net.Http; using System.Text.Json.Serialization; namespace Goa.Functions.ApiGateway; @@ -21,6 +22,7 @@ namespace Goa.Functions.ApiGateway; [JsonSerializable(typeof(short))] [JsonSerializable(typeof(int))] [JsonSerializable(typeof(long))] +[JsonSerializable(typeof(HttpMethod))] [JsonSerializable(typeof(Guid))] [JsonSerializable(typeof(DateTime))] [JsonSerializable(typeof(HostString))]