Skip to content

Commit 1e087c1

Browse files
committed
remove the encoder
1 parent 931468d commit 1e087c1

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

Examples/HelloJSON/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
This is a simple example of an AWS Lambda function that takes a JSON structure as input parameter and returns a JSON structure as response.
44

5+
The runtime takes care of decoding the input and encoding the output.
6+
57
## Code
68

79
The code defines a `HelloRequest` and `HelloResponse` data structure to represent the input and outpout payload. These structures are typically shared with a client project, such as an iOS application.

Examples/HelloJSON/Sources/main.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@ struct HelloResponse: Encodable {
2828
let greetings: String
2929
}
3030

31-
// the JSON encoder. It is created outside of the handler.
32-
// this instance is reused at each invocation.
33-
let encoder = JSONEncoder()
34-
3531
// the Lambda runtime
3632
let runtime = LambdaRuntime {
3733
(event: HelloRequest, context: LambdaContext) in

0 commit comments

Comments
 (0)