Bug: Kafka envelope return an array of arrays of values #3488
Labels
bug
Something isn't working
parser
This item relates to the Parser Utility
pending-release
This item has been merged and will be released soon
Expected Behavior
When parsing an event coming from Kafka, either Self managed or from MSK, the schemas for the Parser utility should return a list of values. These values should be coming from the items within each record and should be base64-decoded into strings.
Current Behavior
Currently the result of the parsing is this:
[['{"key":"value"}']]
aka an array of arrays with the values inside.This is because during our initial implementation we followed the event structure and assumed that there was a relationship many:many between the record keys and the record items. I.e. considering the following sample event:
We wrote the envelope result to accommodate the potential of multiple groups of values, one for each record, with a record being
mytopic-0
and it having a list of items.In reality this can never happen in Lambda because the integration enforces a relationship between 1 topic and one consumer, so in practice the result can be flattened to a simple list of values, i.e.
['{"key":"value"}']
.Code snippet
N/A
Steps to Reproduce
N/A
Possible Solution
No response
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: