Skip to content

Bug: SQS MessageAttribute Schema invalid #3398

Closed as not planned
Closed as not planned
@hrzbrg

Description

Expected Behavior

Using the SQS Envelope and my custom body schema, I expected to be able to parse SQS events generated by Symfony Messenger.

Current Behavior

Parsing fails, because binaryValue is null. The SQS SqsMsgAttributeSchema defines it as optional string, but not nullish.

Code snippet

        "messageAttributes": {
          "X-Symfony-Messenger": {
            "stringValue": "{\"X-Message-Stamp-Symfony\\\\Component\\\\Messenger\\\\Stamp\\\\BusNameStamp\":\"[{\\\"busName\\\":\\\"external.event.bus\\\"}]\"}",
            "binaryValue": null,
            "stringListValues": [],
            "binaryListValues": [],
            "dataType": "String"
          },
          "type": {
            "stringValue": "App\\Event\\ChangeLogEvent",
            "binaryValue": null,
            "stringListValues": [],
            "binaryListValues": [],
            "dataType": "String"
          },
          "Content-Type": {
            "stringValue": "application/json",
            "binaryValue": null,
            "stringListValues": [],
            "binaryListValues": [],
            "dataType": "String"
          }
        },

Steps to Reproduce

  1. Use the Powertools Parser with envelope: SqsEnvelope to parse an SQS event with the above mentioned messageAttributes.

Possible Solution

BinaryValue could be set to be nullish: binaryValue: z.string().nullish()

Powertools for AWS Lambda (TypeScript) version

2.10

AWS Lambda function runtime

20.x

Packaging format used

npm

Execution logs

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdiscussingThe issue needs to be discussed, elaborated, or refinedneed-responseThis item requires a response from a customer and will considered stale after 2 weeksparserThis item relates to the Parser Utilitypending-close-response-requiredThis issue will be closed soon unless the discussion moves forwardrejectedThis is something we will not be working on. At least, not in the measurable future

    Type

    No type

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions