Skip to content

Questions regarding the API Gateway Event Handler #879

Closed Answered by brysontyrrell
bb-rrogers asked this question in Q&A
Discussion options

You must be logged in to vote

👋 Hey there.

I had a chance to talk with @michaelbrewer during re:Invent and walked through how we were using Powertools. We ran into challenges with how we wanted to handle API Gateway event sources with input/output schema validation.

What we ended up doing was using the aws_lambda_powertools.middleware_factory.lambda_handler_decorator to create a middleware that merged together the ideas of the API Gateway event handler and the JSON schema input/output validator.

Here's the interface:

from aws_lambda_powertools.utilities.data_classes import APIGatewayProxyEventV2

from api_common import api_middleware, ApiResponse


@api_middleware(
    event_data_class=APIGatewayProxyEventV2,
    inpu…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@michaelbrewer
Comment options

@bb-rrogers
Comment options

@michaelbrewer
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by heitorlessa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants