Ensure CamelCase of enum serialization (#67)

This commit is contained in:
Peder Holdgaard Pedersen 2025-03-13 15:28:38 +01:00 • committed by GitHub
commit 9c500b4be7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,5 +1,4 @@
using Microsoft.Extensions.Logging; using System.Text.Json;
using System.Text.Json;
using System.Text.Json.Serialization; using System.Text.Json.Serialization;
namespace McpDotNet.Utils.Json; namespace McpDotNet.Utils.Json;
@ -21,7 +20,7 @@ internal static class JsonSerializerOptionsExtensions
// Add custom converters // Add custom converters
options.Converters.Add(new JsonRpcMessageConverter()); options.Converters.Add(new JsonRpcMessageConverter());
options.Converters.Add(new JsonStringEnumConverter()); options.Converters.Add(new JsonStringEnumConverter(JsonNamingPolicy.CamelCase));
// Configure general options // Configure general options
options.PropertyNameCaseInsensitive = true; options.PropertyNameCaseInsensitive = true;