Skip to content

Commit

Permalink
fix: Support httpApi payload override on function level (#1312)
Browse files Browse the repository at this point in the history
  • Loading branch information
shalvah committed Dec 3, 2021
1 parent 7092f3f commit 8db63dd
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/ServerlessOffline.js
Expand Up @@ -369,10 +369,17 @@ export default class ServerlessOffline {
}

httpEvent.http.isHttpApi = true
httpEvent.http.payload =
service.provider.httpApi && service.provider.httpApi.payload
? service.provider.httpApi.payload
: '2.0'
if (
functionDefinition.httpApi &&
functionDefinition.httpApi.payload
) {
httpEvent.http.payload = functionDefinition.httpApi.payload
} else {
httpEvent.http.payload =
service.provider.httpApi && service.provider.httpApi.payload
? service.provider.httpApi.payload
: '2.0'
}
}

if (http && http.private) {
Expand Down

0 comments on commit 8db63dd

Please sign in to comment.