feat(type-safe-api): generate lambda handler stubs based on model trait #537
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change adds a new configuration option
handlers
which allows users to opt in to generating lambda handler projects for java, python, and/or typescript, ready-configured with packaging tasks for use in a lambda function.Handler stubs are generated for operations annotated with the
@handler
trait in Smithy (or thex-handler
vendor extension in OpenAPI), only generating the handler stubs for the chosen language for each operation. Documentation to come once this feature has been further fleshed out!For now, as a very quick reference, here's how you'd reference a lambda in each language from these packages:
Once the handlers have been initially generated, they are never overwritten (much like projen sample code, except generated at build time). If users move or rename generated handlers, they will be generated again - so if not sticking to the default project structure it's recommended to add the
@handler
trait, build, rename/refactor, remove the@handler
trait, and continue.Coming soon: