@@ -395,15 +395,17 @@ sequenceDiagram
395
395
396
396
### Parser integration
397
397
398
- You can define your own schema to parse your batch record payload via the ** ` schema ` ** parameter when initializing the ** ` BatchProcessor ` ** .
398
+ You can define your own schema to parse your batch record payload via the parser configuration options when initializing the ** ` BatchProcessor ` ** .
399
399
400
400
#### Using inner payload schema
401
401
402
402
You can just define the schema of your internal payload and we will handle the parsing for you depending on the type of event that you are using.
403
403
404
+ You can specify any transformers needed to transform your payload before being used for parsing the inner payload.
405
+
404
406
=== "SQS - using inner payload"
405
407
406
- ```typescript hl_lines="9-12 14 17"
408
+ ```typescript hl_lines="9-12 14- 17"
407
409
--8<-- "examples/snippets/batch/parser-integration/sqsWithoutTransformer.ts"
408
410
```
409
411
@@ -415,7 +417,7 @@ You can just define the schema of your internal payload and we will handle the p
415
417
416
418
=== "Kinesis Data Streams - using inner payload"
417
419
418
- ```typescript hl_lines="9-12 14 17 "
420
+ ```typescript hl_lines="9-12 14-17 21 "
419
421
--8<-- "examples/snippets/batch/parser-integration/kinesisWithoutTransformer.ts"
420
422
```
421
423
@@ -427,7 +429,7 @@ You can just define the schema of your internal payload and we will handle the p
427
429
428
430
=== "DynamoDB Streams - using inner payload"
429
431
430
- ```typescript hl_lines="9-12 14 17 "
432
+ ```typescript hl_lines="9-12 14-17 21 "
431
433
--8<-- "examples/snippets/batch/parser-integration/dynamodbWithoutTransformer.ts"
432
434
```
433
435
@@ -437,46 +439,6 @@ You can just define the schema of your internal payload and we will handle the p
437
439
--8<-- "examples/snippets/batch/samples/sampleDynamoDBStreamsEventForParser.json"
438
440
```
439
441
440
- #### Controlling the transformer
441
-
442
- If you want more control over the transformer used for parsing the inner payload, you can provide your own transform helper function.
443
-
444
- === "SQS - using custom transformer"
445
-
446
- ```typescript hl_lines="10-13 15 18"
447
- --8<-- "examples/snippets/batch/parser-integration/sqsWithTransformer.ts"
448
- ```
449
-
450
- === "SQS - Sample Event"
451
-
452
- ```json hl_lines="6 22"
453
- --8<-- "examples/snippets/batch/samples/sampleSQSEventForParser.json"
454
- ```
455
-
456
- === "Kinesis Data Streams - using custom transformer"
457
-
458
- ```typescript hl_lines="10-13 15 18"
459
- --8<-- "examples/snippets/batch/parser-integration/kinesisWithTransformer.ts"
460
- ```
461
-
462
- === "Kinesis - Sample Event"
463
-
464
- ```json hl_lines="6 22"
465
- --8<-- "examples/snippets/batch/samples/sampleKinesisEventForParser.json"
466
- ```
467
-
468
- === "DynamoDB Streams - using custom transformer"
469
-
470
- ```typescript hl_lines="10-13 15 18"
471
- --8<-- "examples/snippets/batch/parser-integration/dynamodbWithTransformer.ts"
472
- ```
473
-
474
- === "DynamoDB - Sample Event"
475
-
476
- ```json hl_lines="13-18 39-44"
477
- --8<-- "examples/snippets/batch/samples/sampleDynamoDBStreamsEventForParser.json"
478
- ```
479
-
480
442
#### Extending the schema yourself
481
443
482
444
If you want to have full control, you can pass an extended schema with any transformers you need.
0 commit comments