aws / aws/aws-lambda-runtime-interface-emulator

Emulate API Gateway payload in event object

Aberta
#64 4 comentários 11 reações 0 responsáveis Ver no GitHub
Linguagem predominante
Go
Estrelas
1.1k
Forks
118
Merge médio
42min
PRs com merge (30d)
2

Descrição

We run our lambdas behind an API Gateway. The event object in the lambda when we run locally does not have the same structure as the event object when running behind an API Gateway.

For example, if I want to post to a path with the `/{model}` parameter, I need to post with this wrapping my payload
```
{
"pathParameters": {
"model": model
},
"body": { .. json payload ...}
}
```
When I call my API Gateway endpoint I do not need to wrap the payload, as this is created by API Gateway as it passes the payload off to the lambda.

What I would really like is to be able to set an ENV var such as `LAMBDA_MODE` which when set to `API_GATEWAY` RIE wraps the event to mimic the event passed by the API Gateway. It would need to work the same for response objects too. If not set, then it would work in the default mode which is how it works today.

Guia de contribuição

Abrir o guia de contribuição

Direção de pesquisa

Comece rastreando como o emulador recebe e constrói atualmente o objeto de evento e, em seguida, inspecione o caminho da resposta. Compare esse comportamento com a estrutura do API Gateway descrita aqui e determine como a configuração LAMBDA_MODE=API_GATEWAY deve afetar tanto o processamento das requisições quanto o das respostas. Está concluído quando o comportamento padrão permanecer inalterado e eventos e respostas no formato do API Gateway forem compatíveis.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
go
Domínio
api, backend
Tipo de issue
Funcionalidade
Dificuldade
4/5
Tempo estimado
3-5 dias
Status de atividade
Estagnada
Clareza
Razoavelmente clara
Facilidade para iniciantes
35/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.