Skip to content

Commit

Permalink
decoding strategy updated
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayush Awasthi committed Feb 4, 2019
1 parent a8e6da1 commit 17d6df2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions KiwiPods/Networking/NetworkModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ public extension ParameterConvertible {
static public func objectFrom(json: Any, decoder: JSONDecoder = JSONDecoder()) throws -> Self? {
do {
let data = try JSONSerialization.data(withJSONObject: json, options: JSONSerialization.WritingOptions.prettyPrinted)
decoder.keyDecodingStrategy = .convertFromSnakeCase
let jsonModel = try decoder.decode(self, from: data)
return jsonModel
} catch let error {
Expand Down

0 comments on commit 17d6df2

Please sign in to comment.