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 {
32
32
extension APIGatewayResponse {
33
33
34
34
public init < Input: Encodable > (
35
- body: Input ,
36
35
statusCode: HTTPResponse . Status ,
37
36
headers: HTTPHeaders ? = nil ,
38
- multiValueHeaders: HTTPMultiValueHeaders ? = nil
37
+ multiValueHeaders: HTTPMultiValueHeaders ? = nil ,
38
+ encodableBody: Input
39
39
) throws {
40
40
self . init (
41
41
statusCode: statusCode,
42
42
headers: headers,
43
43
multiValueHeaders: multiValueHeaders,
44
- body: try body . string ( ) ,
44
+ body: try encodableBody . string ( ) ,
45
45
isBase64Encoded: nil
46
46
)
47
47
}
@@ -50,15 +50,15 @@ extension APIGatewayResponse {
50
50
extension APIGatewayV2Response {
51
51
52
52
public init < Input: Encodable > (
53
- body: Input ,
54
53
statusCode: HTTPResponse . Status ,
55
54
headers: HTTPHeaders ? = nil ,
55
+ encodableBody: Input ,
56
56
cookies: [ String ] ? = nil
57
57
) throws {
58
58
self . init (
59
59
statusCode: statusCode,
60
60
headers: headers,
61
- body: try body . string ( ) ,
61
+ body: try encodableBody . string ( ) ,
62
62
isBase64Encoded: nil ,
63
63
cookies: cookies
64
64
)
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ struct APIGatewayEncodableResponseTests {
33
33
34
34
var response : APIGatewayV2Response ? = nil
35
35
#expect( throws: Never . self) {
36
- try response = APIGatewayV2Response ( body : businessResponse , statusCode : . ok )
36
+ try response = APIGatewayV2Response ( statusCode : . ok , encodableBody : businessResponse )
37
37
}
38
38
try #require( response? . body != nil )
39
39
@@ -57,7 +57,7 @@ struct APIGatewayEncodableResponseTests {
57
57
58
58
var response : APIGatewayResponse ? = nil
59
59
#expect( throws: Never . self) {
60
- try response = APIGatewayResponse ( body : businessResponse , statusCode : . ok )
60
+ try response = APIGatewayResponse ( statusCode : . ok , encodableBody : businessResponse )
61
61
}
62
62
try #require( response? . body != nil )
63
63
You can’t perform that action at this time.
0 commit comments