File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed
Tests/AWSLambdaEventsTests Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -32,10 +32,10 @@ extension Encodable {
32
32
extension APIGatewayResponse {
33
33
34
34
public init < Input: Encodable > (
35
+ body: Input ,
35
36
statusCode: HTTPResponse . Status ,
36
37
headers: HTTPHeaders ? = nil ,
37
- multiValueHeaders: HTTPMultiValueHeaders ? = nil ,
38
- body: Input
38
+ multiValueHeaders: HTTPMultiValueHeaders ? = nil
39
39
) throws {
40
40
self . init (
41
41
statusCode: statusCode,
@@ -50,9 +50,9 @@ extension APIGatewayResponse {
50
50
extension APIGatewayV2Response {
51
51
52
52
public init < Input: Encodable > (
53
+ body: Input ,
53
54
statusCode: HTTPResponse . Status ,
54
55
headers: HTTPHeaders ? = nil ,
55
- body: Input ,
56
56
cookies: [ String ] ? = nil
57
57
) throws {
58
58
self . init (
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 ( statusCode : . ok , body : businessResponse )
36
+ try response = APIGatewayV2Response ( body : businessResponse , statusCode : . ok )
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 ( statusCode : . ok , body : businessResponse )
60
+ try response = APIGatewayResponse ( body : businessResponse , statusCode : . ok )
61
61
}
62
62
try #require( response? . body != nil )
63
63
Original file line number Diff line number Diff line change @@ -95,8 +95,8 @@ class APIGatewayTests: XCTestCase {
95
95
let isBase64Encoded : Bool ?
96
96
}
97
97
98
- func testResponseEncoding( ) throws {
99
- let resp = try APIGatewayResponse (
98
+ func testResponseEncoding( ) {
99
+ let resp = APIGatewayResponse (
100
100
statusCode: . ok,
101
101
headers: [ " Server " : " Test " ] ,
102
102
body: " abc123 "
You can’t perform that action at this time.
0 commit comments