Skip to content

Commit a81bec7

Browse files
committed
fix parameter order to allow trailing closure syntax
1 parent a909dd8 commit a81bec7

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

Sources/AWSLambdaRuntime/Lambda+Codable.swift

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,14 @@ extension LambdaCodableAdapter {
6767

6868
extension LambdaRuntime {
6969
/// Initialize an instance with a `LambdaHandler` defined in the form of a closure **with a non-`Void` return type**.
70-
/// - Parameter body: The handler in the form of a closure.
71-
/// - Parameter encoder: The encoder object that will be used to encode the generic `Output` into a `ByteBuffer`. `JSONEncoder()` used as default.
72-
/// - Parameter decoder: The decoder object that will be used to decode the incoming `ByteBuffer` event into the generic `Event` type. `JSONDecoder()` used as default.
70+
/// - Parameters:
71+
/// - decoder: The decoder object that will be used to decode the incoming `ByteBuffer` event into the generic `Event` type. `JSONDecoder()` used as default.
72+
/// - encoder: The encoder object that will be used to encode the generic `Output` into a `ByteBuffer`. `JSONEncoder()` used as default.
73+
/// - body: The handler in the form of a closure.
7374
public convenience init<Event: Decodable, Output>(
74-
body: sending @escaping (Event, LambdaContext) async throws -> Output,
75+
decoder: JSONDecoder = JSONDecoder(),
7576
encoder: JSONEncoder = JSONEncoder(),
76-
decoder: JSONDecoder = JSONDecoder()
77+
body: sending @escaping (Event, LambdaContext) async throws -> Output
7778
)
7879
where
7980
Handler == LambdaCodableAdapter<
@@ -97,8 +98,8 @@ extension LambdaRuntime {
9798
/// - Parameter body: The handler in the form of a closure.
9899
/// - Parameter decoder: The decoder object that will be used to decode the incoming `ByteBuffer` event into the generic `Event` type. `JSONDecoder()` used as default.
99100
public convenience init<Event: Decodable>(
100-
body: sending @escaping (Event, LambdaContext) async throws -> Void,
101-
decoder: JSONDecoder = JSONDecoder()
101+
decoder: JSONDecoder = JSONDecoder(),
102+
body: sending @escaping (Event, LambdaContext) async throws -> Void
102103
)
103104
where
104105
Handler == LambdaCodableAdapter<

0 commit comments

Comments
 (0)