Skip to content

Commit 100e223

Browse files
am29ddreamorosi
andauthored
fix(parser): set etag optional for delete object notifications (#2429)
* set etag optional, for delete object notifications * remove etag and size from the test event * add comment why etag and size is optional --------- Co-authored-by: Andrea Amorosi <[email protected]>
1 parent 5686f06 commit 100e223

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

Diff for: packages/parser/src/schemas/s3.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ const S3EventNotificationEventBridgeDetailSchema = z.object({
7272
}),
7373
object: z.object({
7474
key: z.string(),
75-
size: z.number().nonnegative().optional(),
76-
etag: z.string(),
75+
size: z.number().nonnegative().optional(), // not present in DeleteObject events
76+
etag: z.string().optional(), // not present in DeleteObject events
7777
'version-id': z.string().optional(),
7878
sequencer: z.string().optional(),
7979
}),

Diff for: packages/parser/tests/events/s3EventBridgeNotificationObjectDeletedEvent.json

-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
},
1717
"object": {
1818
"key": "IMG_m7fzo3.jpg",
19-
"size": 184662,
20-
"etag": "4e68adba0abe2dc8653dc3354e14c01d",
2119
"sequencer": "006408CAD69598B05E"
2220
},
2321
"request-id": "0BH729840619AG5K",

0 commit comments

Comments
 (0)