Open maasim94 opened 5 years ago
I have an object for which there are some properties in init func, while parsing data from JSON to object, it is doing great but while converting Object to JSON, i could not find way to convert that data in JSON
Following is code i'm using
var sOWSubCategory: SowSubCategoryModel? var reportDisplayId : String? required init?(map: Map){ sOWSubCategory = SowSubCategoryModel(sOWSubCategoryID: map.JSON["SOWSubCategoryID"] as? Int, sOWSubCategoryNameAr: map.JSON["SOWSubCategoryNameAr"] as? String, sOWSubCategoryNameEn: map.JSON["SOWSubCategoryNameEn"] as? String) sOWSubCategoryDetail = SowSubCategoryDetailListModel(sOWSubCategoryDetailID: map.JSON["SOWSubCategoryDetailID"] as? Int64, sOWSubCategoryDetailAr: map.JSON["SOWSubCategoryDetailNameAr"] as? String, sOWSubCategoryDetailEn: map.JSON["SOWSubCategoryDetailNameEn"] as? String) } func mapping(map: Map) { reportDisplayId <- map["ReportDisplayID"] }
reportDisplayId is being converted to JSON, but sOWSubCategory and sOWSubCategoryDetail are not
I have an object for which there are some properties in init func, while parsing data from JSON to object, it is doing great but while converting Object to JSON, i could not find way to convert that data in JSON
Following is code i'm using
reportDisplayId is being converted to JSON, but sOWSubCategory and sOWSubCategoryDetail are not