UnmarshalTypeError on CodePipelineEventBridgeEvent
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 42/100
Research direction
Start by inspecting the events.CodePipelineEventBridgeEvent entry point and the CodePipelineEventDetail fields named in the errors. Compare those fields with the EventBridge payload examples in the issue, especially detail.version and detail.type.version. Done means the reported CodePipeline event variants unmarshal without errors using types that match the incoming values.
Written by the indexing model from the issue text.
Description
Is your feature request related to a problem? Please describe.
Triggering a lambda with EventBridge CodePipeline events, i.e.:
{
"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:
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.
- Dominant language
- Go
- Stars
- 3.8k
- Forks
- 578
- Avg merge
- 16h 56m
- Merged PRs (30d)
- 2
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from aws/aws-lambda-go
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
aws/aws-lambda-go#634 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
aws/aws-lambda-go#597 · 3 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
aws/aws-lambda-go#556 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
aws/aws-lambda-go#610 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 62/100
aws/aws-lambda-go#598 ·
All issues in aws/aws-lambda-go
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
crossplane/crossplane#7859 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
bazel-contrib/rules_go#4721 · 2 comments ·
-
needs-triage
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
bug carvel-triage
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
carvel-dev/kapp-controller#1861 ·
-
area/logging kind/bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100