Skip to content

Commit

Permalink
Merge pull request #6 from vapor-community/decodeFix
Browse files Browse the repository at this point in the history
Decode for optional property.
  • Loading branch information
Andrewangeta authored Oct 18, 2019
2 parents c6d1ffc + 06ce01b commit 92c4aae
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public struct StripeExternalAccountsList: StripeModel {
public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
object = try container.decode(String.self, forKey: .object)
hasMore = try container.decode(Bool.self, forKey: .hasMore)
hasMore = try container.decodeIfPresent(Bool.self, forKey: .hasMore)
url = try container.decodeIfPresent(String.self, forKey: .url)

cardAccounts = try container.decodeIfPresent([StripeCard].self, forKey: .data)?.filter{ $0.object == "card" }
Expand Down

0 comments on commit 92c4aae

Please sign in to comment.