Skip to content

Commit 4e5ba49

Browse files
authored
S3 size is optional (#286)
The `size` field can be empty. It just so happens marshaling uses Go's default which is `0`, so this doesn't show up as an error. But if you inspect the payload it can be empty. Though not directly of concern to the go lib, without this it is causing calavera/aws-lambda-events#11.
1 parent ba31528 commit 4e5ba49

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

events/s3.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ type S3Bucket struct {
4747

4848
type S3Object struct {
4949
Key string `json:"key"`
50-
Size int64 `json:"size"`
50+
Size int64 `json:"size,omitempty"`
5151
URLDecodedKey string `json:"urlDecodedKey"`
5252
VersionID string `json:"versionId"`
5353
ETag string `json:"eTag"`

0 commit comments

Comments
 (0)