Maintenance: add mechanism to check compatibility with @types/aws-lambda package #1818
Open
1 of 2 tasks
Labels
discussing
The issue needs to be discussed, elaborated, or refined
internal
PRs that introduce changes in governance, tech debt and chores (linting setup, baseline, etc.)
parser
This item relates to the Parser Utility
Summary
When using our built-in schema with zod, developers can infer the types with
type SqsEvent = z.infer<typeof SqsSchema>
and use it in their Lambda handler. Another popular option is to use@types/aws-lambda
package wich has 3M downloads per week. We need to make sure that both types are compatible, so there is no confusion or unexpected behaviour.Why is this needed?
If either
@types/aws-lambda
or our schema is updated, we want to have a reliable test to verify that they are both compatible and if not to fix one them.Which area does this relate to?
Parser
Solution
I have checked the first idea that worked:
The compiler will fail if the structure does not match and will tell exactly which properties are not compatible.
Alternatively research more about https://github.com/fabien0102/ts-to-zod. If we can convert
@types/aws-lambda
to schemas, we might directly compare the schemas to find the differences.Acknowledgment
Future readers
Please react with 👍 and your use case to help us understand customer demand.
The text was updated successfully, but these errors were encountered: