V0.1.4
Updates
Templates
You can now add s-templates.json
files to the root of your Project, Components, Modules and Functions. Even better, you can inherit templates from parent level template files and extend them in sub-template files. For example:
// project/s-templates.json
{
"apiRequestTemplate": {
"application/json": {
"httpMethod": "$context.httpMethod"
}
}
}
// project/component/module/functions-template.json
{
"apiRequestTemplate": {
"application/json": {
"pathId": "$input.params('id')"
}
}
}
// This will populate the function endpoint's request template with the merged template:
{
"apiRequestTemplate": {
"application/json": {
"httpMethod": "$context.httpMethod",
"pathId": "$input.params('id')"
}
}
}
You can use templates in an s-.json
files and they will inherit/extend themselves intelligently. The Serverless-Starter project has been updated to show examples of useful template inheritance.
More Class Methods
Many classes now have additional methods which you can call to get their parent assets. For example, ServerlessFunction has:
.getModule()
.getComponent()
.getProject()
Bug Fixes
Template Inheritance Bug
In v0.1.3
templates do not inherit subjectively by the assets that were calling them.