For each OpenApi tag, LazyStack inserts an AWS::Serverless::Function resource into the serverless.template file. Under that resource, each of the routes is represented by an Events entry. Below, we trace the GET /order/{order} endpoint from the OpenApi specification, through the AWS Serverless Template Event to the OrderController namespace.
Route |
Lambda Function |
Event Method |
|
---|---|---|---|
/order/{orderId} |
GET |
Order |
GetOrderById(int64 Id) |
/pet/{petId} |
GET |
Pet |
GetPetById(int64 Id) |
The OpenApi Operation object field operationId is optional. If unspecified, LazyStack uses the path and operation to generate event method names. For instance, without the operationId “getOrderById” the route ‘/order/{orderId}’ GET would generate the method name “OrderOrderIdGet”.