UnmarshalTypeError on CodePipelineEventBridgeEvent
- 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.**
Triggering a lambda with EventBridge CodePipeline events, i.e.:
```json
{
"detail-type": [
"CodePipeline Pipeline Execution State Change",
"CodePipeline Stage Execution State Change",
"CodePipeline Action Execution State Change"
],
"source": [
"aws.codepipeline"
]
}
```
The Lambda in question has this structure:
```go
func handler(_ context.Context, event *events.CodePipelineEventBridgeEvent) error {}
```
Upon execution, it almost immediately fails and outputs one of two errors (so far):
```
json: cannot unmarshal number 2.0 into Go struct field CodePipelineEventDetail.detail.version of type int64
```
```
json: cannot unmarshal string into Go struct field CodePipelineEventDetailType.detail.type.version of type int64
```
**Describe the solution you'd like**
I'm fairly certain I'm using the correct event type here, but I could be wrong. However, I'd like a solution to the lambda not failing immediately and the type being correct for what EventBridge is passing into the lambda.
Contributor guide
Assessment
This issue has not been assessed yet.