-
Notifications
You must be signed in to change notification settings - Fork 575
Closed
Description
CloudWatchEvents seem to not match the structure of CodeBuildEvents and when performing json.Unmarshal() throws an error:
json: cannot unmarshal number 60.0 into Go struct field CodeBuildEventAdditionalInformation.timeout-in-minutes of type int64: UnmarshalTypeError
null
It looks like Test Data (with minor changes) was pulled from: AWS Build Notification Docs which may have been correct at the time but what I am observing being returned from CloudWatchEvents is 60.0 not 60
You should be able to recreate with a simple lambda listening to CloudWatchEvents with source: "aws.codebuild"
package main
import (
"github.com/aws/aws-lambda-go/events"
"github.com/aws/aws-lambda-go/lambda"
)
func CodeBuildNotifier(event events.CodeBuildEvent) {}
func main() {
lambda.Start(CodeBuildNotifier)
}
This looks like it can be fixed easily by changing the types in https://github.com/aws/aws-lambda-go/blob/master/events/duration.go to float64 instead of int64 PR to follow.
Metadata
Metadata
Assignees
Labels
No labels