Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrected enum case in README for type arguments. #19

Merged
merged 1 commit into from
Nov 18, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Corrected enum case in README for type arguments.
  • Loading branch information
Dave Camp authored and Dave Camp committed Nov 10, 2016
commit b18c4d593613ac744f86fdbb12f5712d772adb3b
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,12 @@ extension Person : Decodable {
let dateDecoder = DateDecoder(dateFormatString: "yyyy-MM-dd")

let entity = try Parser.parseEntity(json: json) { schema in
schema.addProperty(keyPath: idKeyPath, type: .Int)
schema.addProperty(keyPath: nameKeyPath, type: .String)
schema.addProperty(keyPath: nicknameKeyPath, type: .String, optional: true)
schema.addProperty(keyPath: birthDateKeyPath, type: .String, decoder: dateDecoder)
schema.addProperty(keyPath: isMemberKeyPath, type: .Bool, optional: true)
schema.addProperty(keyPath: addressesKeyPath, type: .Array, decodedToType: Address.self)
schema.addProperty(keyPath: idKeyPath, type: .int)
schema.addProperty(keyPath: nameKeyPath, type: .string)
schema.addProperty(keyPath: nicknameKeyPath, type: .string, optional: true)
schema.addProperty(keyPath: birthDateKeyPath, type: .string, decoder: dateDecoder)
schema.addProperty(keyPath: isMemberKeyPath, type: .bool, optional: true)
schema.addProperty(keyPath: addressesKeyPath, type: .array, decodedToType: Address.self)
}

self.identifier = entity <-! idKeyPath
Expand Down Expand Up @@ -189,9 +189,9 @@ class AvatarDecoder: Decoder {
let heightKeyPath = "height"

let entity = try Parser.parseEntity(json: json) { schema in
schema.addProperty(keyPath: urlKeyPath, type: .URL)
schema.addProperty(keyPath: widthKeyPath, type: .Int)
schema.addProperty(keyPath: heightKeyPath, type: .Int)
schema.addProperty(keyPath: urlKeyPath, type: .url)
schema.addProperty(keyPath: widthKeyPath, type: .int)
schema.addProperty(keyPath: heightKeyPath, type: .int)
}

return Avatar(
Expand All @@ -211,9 +211,9 @@ class AlternateAvatarDecoder: Decoder {
let hKeyPath = "h"

let entity = try Parser.parseEntity(json: json) { schema in
schema.addProperty(keyPath: locationKeyPath, type: .URL)
schema.addProperty(keyPath: wKeyPath, type: .Int)
schema.addProperty(keyPath: hKeyPath, type: .Int)
schema.addProperty(keyPath: locationKeyPath, type: .url)
schema.addProperty(keyPath: wKeyPath, type: .int)
schema.addProperty(keyPath: hKeyPath, type: .int)
}

return Avatar(
Expand Down Expand Up @@ -264,7 +264,7 @@ And here is how it's used to parse a JSON date string:
let dateDecoder = DateDecoder(dateFormatString: "yyyy-MM-dd 'at' HH:mm")

let entity = try Parser.parseEntity(data: data) { schema in
schema.addProperty(keyPath: "dateString", type: .String, decoder: dateDecoder)
schema.addProperty(keyPath: "dateString", type: .string, decoder: dateDecoder)
}
```

Expand Down