You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When working with the SqsEnvelope I should be able to extract the message body regardless of whether it's a plain text string or a JSON-stringified one.
Current Behavior
When the message body is not a JSON-stringified object the envelope throws a runtime error as it's unable to parse it with JSON.parse().
Expected Behavior
When working with the
SqsEnvelope
I should be able to extract the message body regardless of whether it's a plain text string or a JSON-stringified one.Current Behavior
When the message body is not a JSON-stringified object the envelope throws a runtime error as it's unable to parse it with
JSON.parse()
.Code snippet
Steps to Reproduce
Send a message like this:
Observe the logs:
Possible Solution
We should avoid parsing by default and instead leave it to the caller to decide.
While working on this, we should also check the SQS Schema and the SNS + SQS Envelope, since they share some of the code.
Additionally, we should ensure the schema fails parsing when the
Records
array is empty, as mentioned in #3475.Powertools for AWS Lambda (TypeScript) version
latest
AWS Lambda function runtime
22.x
Packaging format used
npm
Execution logs
The text was updated successfully, but these errors were encountered: