Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Otherwise it will not work witch Swift 3.0.2/Xcode 8.2
  • Loading branch information
frootloops authored Dec 28, 2016
1 parent f6f2fdc commit c7af578
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,14 @@ struct User {
}

extension User: Decodable {
static func decode(j: JSON) -> Decoded<User> {
static func decode(_ json: JSON) -> Decoded<User> {
return curry(User.init)
<^> j <| "id"
<*> j <| "name"
<*> j <|? "email" // Use ? for parsing optional values
<*> j <| "role" // Custom types that also conform to Decodable just work
<*> j <| ["company", "name"] // Parse nested objects
<*> j <|| "friends" // parse arrays of objects
<^> json <| "id"
<*> json <| "name"
<*> json <|? "email" // Use ? for parsing optional values
<*> json <| "role" // Custom types that also conform to Decodable just work
<*> json <| ["company", "name"] // Parse nested objects
<*> json <|| "friends" // parse arrays of objects
}
}

Expand Down

0 comments on commit c7af578

Please sign in to comment.