From a9f1c93a1531fa136d46ce64b6fd82343c0991ad Mon Sep 17 00:00:00 2001 From: Rich Ellis Date: Mon, 19 Sep 2016 13:29:31 -0700 Subject: [PATCH] Updated README example to align with text The first note below the `Person` example code refers to declaring the `Decodable` conformance in an extension. Updated the example code to reflect this. --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f14a4d8..a03f613 100644 --- a/README.md +++ b/README.md @@ -103,14 +103,16 @@ public protocol Decodable { The `json: Any` will typically be a `[String: Any]` instance that was created from the `JSONSerialization` APIs. Use the Elevate `Parser.parseEntity` method to define the structure of the JSON data to be validated and perform the parsing. ```swift -struct Person: Decodable { +struct Person { let identifier: String let name: String let nickname: String? let birthDate: Date let isMember: Bool? let addresses: [Address] +} +extension Person : Decodable { init(json: Any) throws { let idKeyPath = "identifier" let nameKeyPath = "name"