using System.Text.Json; namespace Amazon.Lambda.Serialization.SystemTextJson { /// /// Custom ILambdaSerializer implementation which uses System.Text.Json /// for serialization. /// /// /// When serializing objects to JSON camel casing will be used for JSON property names. /// /// /// If the environment variable LAMBDA_NET_SERIALIZER_DEBUG is set to true the JSON coming /// in from Lambda and being sent back to Lambda will be logged. /// /// public class CamelCaseLambdaJsonSerializer : DefaultLambdaJsonSerializer { /// /// Constructs instance of serializer. /// public CamelCaseLambdaJsonSerializer() : base(ConfigureJsonSerializerOptions) { } private static void ConfigureJsonSerializerOptions(JsonSerializerOptions options) { options.PropertyNamingPolicy = new AwsNamingPolicy(JsonNamingPolicy.CamelCase); } } }