AWS lambda typescript handler schema validation

Viewed 511

I'm fairly new to Typescript and I'm looking for advice on how to access the event.body type from the handler function rather than defining an interface. I'm using the serverless aws-nodejs-typescript template.

The request schema:

enter image description here

handler function:

enter image description here

As you can see the createBeneficiary function accepts any type, now I would prefer for it to be strongly typed, I can create and interface but I wondered if there was a better way since it's already defined in the request schema. Thanks!

0 Answers
Related