mirror of
https://github.com/swift-server/swift-aws-lambda-runtime.git
synced 2026-06-02 07:27:33 +00:00
This PR adds an APIGateway V1 example, which differs slightly from the existing [V2 example](https://github.com/swift-server/swift-aws-lambda-runtime/tree/main/Examples/APIGateway). ### Motivation: While APIGatewayV2 has existed for a while, there are still some scenarios where V1 is preferable (see [Choose between REST APIs and HTTP APIs](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-vs-rest.html) for more details). This PR adds a working example for the `Api` endpoint type. ### Modifications: Sources/main.swift - Swapped APIGatewayRequestV2 and APIGatewayResponseV2 for their unversioned counterparts (aka V1). template.yaml - Changed the Events name and corresponding `Type: Api` values. - Added necessary additional properties to define a `GET` endpoint for an `Api` endpoint. Readme.md - Updated the request and response example outputs. ### Result: Now, an APIGateway and APIGatewayV1 example exist. > [!NOTE] > It is the author's opinion that this new example should technically be called `APIGateway` and the existing one should be renamed to `APIGatewayV2` to keep consistent with the request and response type naming conventions, but this is omitted from this request to be less disruptive.