When the LAMBDA_NET_SERIALIZER_DEBUG environment variable is set, Amazon.Lambda.Serialization.SystemTextJson.DefaultLambdaJsonSerializer doesn't actually write out the contents of the object being serialized. I looked into the issue here:
https://github.com/aws/aws-lambda-dotnet/blob/master/Libraries/src/Amazon.Lambda.Serialization.SystemTextJson/DefaultLambdaJsonSerializer.cs#L80
debugWriter
(below snippet pasted from link above) never has a value set. So, debugWriter.ToString()
always prints an empty string.
```C#
using (var debugWriter = new StringWriter())
using (var utf8Writer = new Utf8JsonWriter(responseStream))
{
JsonSerializer.Serialize(utf8Writer, response, SerializerOptions);
var jsonDocument = debugWriter.ToString();
Console.WriteLine($"Lambda Serialize {response.GetType().FullName}: {jsonDocument}");
var writer = new StreamWriter(responseStream);
writer.Write(jsonDocument);
writer.Flush();
}
```
Thanks for reporting the issue. I'm taking a look.
Version 2.0.1 of Amazon.Lambda.Serialziation.SystemTextJson is out with this fix. Thanks for reporting the issue.
Most helpful comment
Version 2.0.1 of Amazon.Lambda.Serialziation.SystemTextJson is out with this fix. Thanks for reporting the issue.