Skip to content

Commit eb634fa

Browse files
authored
Remove unnecessary handler constraints (#499)
1 parent 3ce0a87 commit eb634fa

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

Diff for: Sources/AWSLambdaRuntime/Lambda+Codable.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ public struct LambdaCodableAdapter<
116116
}
117117

118118
/// A ``StreamingLambdaHandler/handle(_:responseWriter:context:)`` wrapper.
119-
/// - Parameters:
120-
/// - event: The received event.
121-
/// - outputWriter: The writer to write the computed response to.
119+
/// - Parameters:
120+
/// - request: The received event.
121+
/// - responseWriter: The writer to write the computed response to.
122122
/// - context: The ``LambdaContext`` containing the invocation's metadata.
123123
@inlinable
124124
public mutating func handle<Writer: LambdaResponseStreamWriter>(

Diff for: Sources/AWSLambdaRuntime/LambdaHandlers.swift

+6-5
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public protocol LambdaResponseStreamWriter {
6767
public protocol LambdaHandler {
6868
/// Generic input type.
6969
/// The body of the request sent to Lambda will be decoded into this type for the handler to consume.
70-
associatedtype Event: Decodable
70+
associatedtype Event
7171
/// Generic output type.
7272
/// This is the return type of the ``LambdaHandler/handle(_:context:)`` function.
7373
associatedtype Output
@@ -89,7 +89,7 @@ public protocol LambdaHandler {
8989
public protocol LambdaWithBackgroundProcessingHandler {
9090
/// Generic input type.
9191
/// The body of the request sent to Lambda will be decoded into this type for the handler to consume.
92-
associatedtype Event: Decodable
92+
associatedtype Event
9393
/// Generic output type.
9494
/// This is the type that the `handle` function will send through the ``LambdaResponseWriter``.
9595
associatedtype Output
@@ -183,9 +183,10 @@ extension LambdaRuntime {
183183
}
184184

185185
/// Initialize an instance with a ``LambdaHandler`` defined in the form of a closure **with a non-`Void` return type**, an encoder, and a decoder.
186-
/// - Parameter body: The handler in the form of a closure.
187-
/// - Parameter encoder: The encoder object that will be used to encode the generic `Output` into a `ByteBuffer`.
188-
/// - Parameter decoder: The decoder object that will be used to decode the incoming `ByteBuffer` event into the generic `Event` type.
186+
/// - Parameters:
187+
/// - encoder: The encoder object that will be used to encode the generic `Output` into a `ByteBuffer`.
188+
/// - decoder: The decoder object that will be used to decode the incoming `ByteBuffer` event into the generic `Event` type.
189+
/// - body: The handler in the form of a closure.
189190
public convenience init<
190191
Event: Decodable,
191192
Output: Encodable,

0 commit comments

Comments
 (0)