Closed
Description
Expected Behaviour
Original issue: aws-powertools/powertools-lambda-typescript#3483
The identitySource
field in ApiGatewayAuthorizerRequestV2
can be None
when the Lambda authorizer is not configured with an identity source.
Current Behaviour
Its always considering a List
with at least 1 record, but can be None
.
Code snippet
import json
from aws_lambda_powertools.utilities.parser import parse
from aws_lambda_powertools.utilities.parser.models import ApiGatewayAuthorizerRequestV2
def lambda_handler(event, context):
parsed_event = parse(model=ApiGatewayAuthorizerRequestV2, event=event)
return {
'statusCode': 200,
'body': json.dumps('Hello from Lambda!')
}
Possible Solution
Add Optional.
Steps to Reproduce
1 - Deploy the code below
2 - Invoke the Lambda with a valid payload from API GW HTTP Authorizer v2
Powertools for AWS Lambda (Python) version
latest
AWS Lambda function runtime
3.13
Packaging format used
Lambda Layers, Serverless Application Repository (SAR) App, PyPi
Debugging logs
Metadata
Metadata
Assignees
Type
Projects
Status
Shipped