We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
User model :
import Foundation import ObjectMapper class User: Mappable { // Variables var userInfo: UserInfo? var token: String? required init?(map: Map) { } func mapping(map: Map) { self.userInfo <- map["user_info"] self.token <- map["token"] } } class UserInfo: Mappable { // Variables var fullName: String? var firstName: String? var lastName: String? var email: String? var employeeCode: Int? required init?(map: Map) { } func mapping(map: Map) { self.fullName <- map["full_name"] self.firstName <- map["first_name"] self.lastName <- map["last_name"] self.email <- map["email_id"] self.employeeCode <- map["emp_code"] } }
Actual JSON :
{ "user_info": { "full_name": "test full name", "first_name": "test first name", "last_name": "test last name", "email_id": "[email protected]", "emp_code": 111 }, "token": "------" }
Alamofire request :
AF.request("\(TimelyUrls.shared.kServerUrl)\(TimelyUrls.shared.kLoginUrl)", method: .post, parameters: requestDict, encoding: JSONEncoding.default, headers: TimelyUrls.shared.HEADER).responseObject { (response: DataResponse<User>) in print(response.result) }
Crash received on responseObject :
responseObject
Note : The request works fine. When I try a simple Alamofire request, it works :
AF.request("\(TimelyUrls.shared.kServerUrl)\(TimelyUrls.shared.kLoginUrl)", method: .post, parameters: requestDict, encoding: JSONEncoding.default, headers: TimelyUrls.shared.HEADER).responseJSON { (response) in print(response) }
Important : Tested the library's sample (WeatherResponse on home page). It gives the same crash.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
User model :
Actual JSON :
Alamofire request :
Crash received on
responseObject
:Note : The request works fine. When I try a simple Alamofire request, it works :
Important : Tested the library's sample (WeatherResponse on home page). It gives the same crash.
The text was updated successfully, but these errors were encountered: