3 ms·
You'll notice in those models that body, path, query string, etc. are all strings. There is no validation of data type at runtime, and no strong typing to model
by bjohnm 2y ago
You'll notice in those models that body, path, query string, etc. are all strings. There is no validation of data type at runtime, and no strong typing to models at compile/transpile time. This library allows you do redefine the APIGatewayEvents style models so that they are specific to your types, with inbuilt validation.
It also supports a full middleware pipeline under the covers for common concerns.
- mlhpdx 2y agoAh, that makes sense. Strangely enough, though I use a statically typed language for Lambdas I stopped using in in-built coercion to the type in the handler signatures somewhere along the line. These days I’m almost always skipping the extra dependencies (usually a shared library for the POCOs, and more) and just process the JSON object literally, and produce one as a result. It’s been a good thing I think on my projects; smaller, simpler code.