Skip to content

Using Parser With Batch Processor #3309

Answered by dreamorosi
root0x asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @root0x, apologies for the late reply - we missed the notification.

You can use both utilities together, however there are some caveats.

From your question it seems that you're alluding to the fact that you're using one of the built-in envelopes from Parser rather than one of the schemas. Envelopes extract the payload from an event, in this case the body, transform it, and parse it - this means all other fields are dropped.

If you want to keep the entire payload, you should instead be using the built-in SqsSchema like this:

import { Logger } from '@aws-lambda-powertools/logger';
import { parser } from '@aws-lambda-powertools/parser/middleware';
import { SqsSchema } from '@aws-lambda-po…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@root0x
Comment options

Answer selected by root0x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants