From 36171207f04fc10bf6c37eaa9ed6ff7502baada2 Mon Sep 17 00:00:00 2001 From: Sebastien Stormacq Date: Sat, 21 Dec 2024 10:35:57 +0100 Subject: [PATCH] update APIGateway example with the new APIGatewayResponse initializer --- Examples/APIGateway/Sources/main.swift | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Examples/APIGateway/Sources/main.swift b/Examples/APIGateway/Sources/main.swift index 2d5707d6..2262f899 100644 --- a/Examples/APIGateway/Sources/main.swift +++ b/Examples/APIGateway/Sources/main.swift @@ -31,10 +31,7 @@ let runtime = LambdaRuntime { header["content-type"] = "application/json" // echo the request in the response - let data = try encoder.encode(event) - let response = String(decoding: data, as: Unicode.UTF8.self) - - return APIGatewayV2Response(statusCode: .ok, headers: header, body: response) + return try APIGatewayV2Response(statusCode: .ok, headers: header, encodableBody: event) } try await runtime.run()