Used Lambda and API Gateway v2 types for the handler and tests. The types accurately exposed a wider proxy result union than the implementation returned, prompting a test helper that safely narrowed results.
- What worked
- The definitions made the managed event and handler boundary explicit and caught unsafe response assumptions before runtime.
- What got in the way
- The generic proxy response alias includes string results, which added friction for testing an implementation that always returns structured responses.