When invoking a .NET AWS Lambda function with JSON payloads where numbers are represented as strings, the DefaultLambdaJsonSerializer fails with a JsonSerializerException. Two workarounds are presented: (1) subclassing DefaultLambdaJsonSerializer to set JsonNumberHandling.AllowReadingFromString in the serializer options, and (2) accepting a Stream as the function handler input and performing manual deserialization with custom JsonSerializerOptions.

3m read timeFrom nodogmablog.bryanhogan.net
Post cover image
Table of contents
Creating your own implementation of a serializer/deserializerTaking a Stream as the input to your Lambda function