JSONDeserializer

public class JSONDeserializer<T> where T : JSONModel

Undocumented

  • Finds the internal dictionary in dict as the designatedPath specified, and map it to a Model designatedPath is a string like result.data.orderInfo, which each element split by . represents key of each layer, or nil

    Declaration

    Swift

    public static func deserializeFrom(dict: [String : Any]?, designatedPath: String? = nil) -> T?
  • Finds the internal JSON field in json as the designatedPath specified, and converts it to Model designatedPath is a string like result.data.orderInfo, which each element split by . represents key of each layer, or nil

    Declaration

    Swift

    public static func deserializeFrom(json: String?, designatedPath: String? = nil) -> T?
  • Finds the internal JSON field in array as the designatedPath specified, and converts it to Model designatedPath is a string like result.data.orderInfo, which each element split by . represents key of each layer, or nil

    Declaration

    Swift

    public static func deserializeFrom(array: [Any]?, designatedPath: String? = nil) -> T?
  • Finds the internal dictionary in dict as the designatedPath specified, and use it to reassign an exist model designatedPath is a string like result.data.orderInfo, which each element split by . represents key of each layer, or nil

    Declaration

    Swift

    public static func update(object: inout T, from dict: [String : Any]?, designatedPath: String? = nil)
  • Finds the internal JSON field in json as the designatedPath specified, and use it to reassign an exist model designatedPath is a string like result.data.orderInfo, which each element split by . represents key of each layer, or nil

    Declaration

    Swift

    public static func update(object: inout T, from json: String?, designatedPath: String? = nil)
  • Finds the internal JSON field in array as the designatedPath specified, and use it to reassign an exist model designatedPath is a string like result.data.orderInfo, which each element split by . represents key of each layer, or nil

    Declaration

    Swift

    public static func update(object: inout T, from array: [Any]?, designatedPath: String? = nil)
  • if the JSON field found by designatedPath in json is representing a array, such as [{...}, {...}, {...}], this method converts it to a Models array

    Declaration

    Swift

    public static func deserializeModelArrayFrom(json: String?, designatedPath: String? = nil) -> [T?]?
  • if the JSON field found by designatedPath in object is representing a array, such as [{...}, {...}, {...}], this method converts it to a Models array

    Declaration

    Swift

    public static func deserializeModelArrayFrom(dict: [AnyHashable : Any]?, designatedPath: String? = nil) -> [T?]?
  • mapping raw array to Models array

    Declaration

    Swift

    public static func deserializeModelArrayFrom(array: [Any]?, designatedPath: String? = nil) -> [T?]?