Skip to content

Bug: APIGatewayRequestAuthorizerEventV2Schema has invalid definition for the identitySource field #3483

Closed
@hibanka

Description

@hibanka

Expected Behavior

The identitySource field in APIGatewayRequestAuthorizerEventV2 can be null when the Lambda authorizer is not configured with an identity source (see screenshot from the AWS Console below).

Image

Current Behavior

The current definition does not account for this scenario, leading to an error:

identitySource: APIGatewayStringArray,

Image

Even the @types/aws-lambda package has invalid type definition:

https://github.com/DefinitelyTyped/DefinitelyTyped/blob/01bf6ea3ae73629f4d488d777df91781e466ba15/types/aws-lambda/trigger/api-gateway-authorizer.d.ts#L38

Code snippet

APIGatewayRequestAuthorizerEventV2Schema.parse(event);

Steps to Reproduce

When creating a Lambda authorizer, do not specify an identity source.

Possible Solution

add .nullable()

Powertools for AWS Lambda (TypeScript) version

latest

AWS Lambda function runtime

20.x

Packaging format used

npm

Execution logs

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcompletedThis item is complete and has been merged/shippedparserThis item relates to the Parser Utility

Type

No type

Projects

Status

Shipped

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions