Skip to content
This repository was archived by the owner on Aug 8, 2024. It is now read-only.

Add rawBody to ProxyIntegrationBody #78

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions lib/proxyIntegration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ type ProxyIntegrationParams = {
}

type ProxyIntegrationBody<T = unknown> = {
rawBody?: T
body: T
}

Expand Down Expand Up @@ -137,6 +138,7 @@ export const process: ProcessMethod<ProxyIntegrationConfig, APIGatewayProxyEvent
proxyEvent.routePath = actionConfig.routePath
if (event.body) {
try {
proxyEvent.rawBody = event.body
proxyEvent.body = JSON.parse(event.body)
} catch (parseError) {
console.log(`Could not parse body as json: ${event.body}`, parseError)
Expand Down