File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
Tests/AWSLambdaEventsTests Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -32,16 +32,16 @@ extension Encodable {
3232extension APIGatewayResponse {
3333
3434 public init < Input: Encodable > (
35- body: Input ,
3635 statusCode: HTTPResponse . Status ,
3736 headers: HTTPHeaders ? = nil ,
38- multiValueHeaders: HTTPMultiValueHeaders ? = nil
37+ multiValueHeaders: HTTPMultiValueHeaders ? = nil ,
38+ encodableBody: Input
3939 ) throws {
4040 self . init (
4141 statusCode: statusCode,
4242 headers: headers,
4343 multiValueHeaders: multiValueHeaders,
44- body: try body . string ( ) ,
44+ body: try encodableBody . string ( ) ,
4545 isBase64Encoded: nil
4646 )
4747 }
@@ -50,15 +50,15 @@ extension APIGatewayResponse {
5050extension APIGatewayV2Response {
5151
5252 public init < Input: Encodable > (
53- body: Input ,
5453 statusCode: HTTPResponse . Status ,
5554 headers: HTTPHeaders ? = nil ,
55+ encodableBody: Input ,
5656 cookies: [ String ] ? = nil
5757 ) throws {
5858 self . init (
5959 statusCode: statusCode,
6060 headers: headers,
61- body: try body . string ( ) ,
61+ body: try encodableBody . string ( ) ,
6262 isBase64Encoded: nil ,
6363 cookies: cookies
6464 )
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ struct APIGatewayEncodableResponseTests {
3333
3434 var response : APIGatewayV2Response ? = nil
3535 #expect( throws: Never . self) {
36- try response = APIGatewayV2Response ( body : businessResponse , statusCode : . ok )
36+ try response = APIGatewayV2Response ( statusCode : . ok , encodableBody : businessResponse )
3737 }
3838 try #require( response? . body != nil )
3939
@@ -57,7 +57,7 @@ struct APIGatewayEncodableResponseTests {
5757
5858 var response : APIGatewayResponse ? = nil
5959 #expect( throws: Never . self) {
60- try response = APIGatewayResponse ( body : businessResponse , statusCode : . ok )
60+ try response = APIGatewayResponse ( statusCode : . ok , encodableBody : businessResponse )
6161 }
6262 try #require( response? . body != nil )
6363
You can’t perform that action at this time.
0 commit comments