aws / aws/aws-lambda-go

Use MessageAttributeValue in event types

Open
#334 0 comments 5 reactions 0 assignees View on GitHub
breaking change / v2 type/events type/ux
Dominant language
Go
Stars
3.8k
Forks
578
Avg merge
8h 18m
Merged PRs (30d)
1

Description

**Is your feature request related to a problem? Please describe.**
MessageAttribute on SNSEntity is defined with type `map[string]interface{}` instead of `map[string]MessageAttributeValue` which makes parsing attribute values out of an SNS entity rather cumbersome:

```go
attr := entity.MessageAttributes["foo"]
attrVal := attr.(map[string]interface{})
stringValue := attrVal["StringValue"]
```

**Describe the solution you'd like**
Change the type of the `MessageAttributes` so that the map values are `MessageAttributeValue`s.

**Describe alternatives you've considered**
Marshal the MessageAttributes to JSON and then Unmarshall to `map[string]MessageAttributeValue`, but this seems wasteful.

This is similar to issue #58 .

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.