Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/parser/src/schemas/apigw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@ const APIGatewayProxyEventSchema = z.object({
'OPTIONS',
]),
headers: z.record(z.string()).optional(),
queryStringParameters: z.record(z.string()).optional(),
queryStringParameters: z.record(z.string()).nullable(),
multiValueHeaders: z.record(z.array(z.string())).optional(),
multiValueQueryStringParameters: z.record(z.array(z.string())).optional(),
multiValueQueryStringParameters: z.record(z.array(z.string())).nullable(),
requestContext: APIGatewayEventRequestContext,
pathParameters: z.record(z.string()).optional().nullish(),
stageVariables: z.record(z.string()).optional().nullish(),
isBase64Encoded: z.boolean().optional(),
body: z.string().optional(),
body: z.string().nullable(),
});

export { APIGatewayProxyEventSchema, APIGatewayCert };
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
"queryStringParameters": {
"QueryString1": "queryValue1"
},
"multiValueQueryStringParameters": {
"QueryString1": ["queryValue1"]
},
"pathParameters": {},
"stageVariables": {
"StageVar1": "stageValue1"
Expand Down Expand Up @@ -64,5 +67,6 @@
"resourceId": "ANY /request",
"resourcePath": "/request",
"stage": "test"
}
},
"body": null
}
4 changes: 2 additions & 2 deletions packages/parser/tests/unit/envelopes/apigwt.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe('ApigwEnvelope ', () => {

it('should throw no body provided', () => {
const testEvent = TestEvents.apiGatewayProxyEvent as APIGatewayProxyEvent;
testEvent.body = undefined;
testEvent.body = null;

expect(() => ApiGatewayEnvelope.parse(testEvent, TestSchema)).toThrow(
ParseError
Expand Down Expand Up @@ -56,7 +56,7 @@ describe('ApigwEnvelope ', () => {

it('should return success false with original body if no body provided', () => {
const testEvent = TestEvents.apiGatewayProxyEvent as APIGatewayProxyEvent;
testEvent.body = undefined;
testEvent.body = null;

const resp = ApiGatewayEnvelope.safeParse(testEvent, TestSchema);
expect(resp).toEqual({
Expand Down