{"action":"created","issue":{"url":"https://api.github.com/repos/SwiftyJSON/SwiftyJSON/issues/638","repository_url":"https://api.github.com/repos/SwiftyJSON/SwiftyJSON","labels_url":"https://api.github.com/repos/SwiftyJSON/SwiftyJSON/issues/638/labels{/name}","comments_url":"https://api.github.com/repos/SwiftyJSON/SwiftyJSON/issues/638/comments","events_url":"https://api.github.com/repos/SwiftyJSON/SwiftyJSON/issues/638/events","html_url":"https://github.com/SwiftyJSON/SwiftyJSON/issues/638","id":178256826,"number":638,"title":"Swifty JSON Not Working ","user":{"login":"uday-mshr","id":19321534,"avatar_url":"https://avatars.githubusercontent.com/u/19321534?v=3","gravatar_id":"","url":"https://api.github.com/users/uday-mshr","html_url":"https://github.com/uday-mshr","followers_url":"https://api.github.com/users/uday-mshr/followers","following_url":"https://api.github.com/users/uday-mshr/following{/other_user}","gists_url":"https://api.github.com/users/uday-mshr/gists{/gist_id}","starred_url":"https://api.github.com/users/uday-mshr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uday-mshr/subscriptions","organizations_url":"https://api.github.com/users/uday-mshr/orgs","repos_url":"https://api.github.com/users/uday-mshr/repos","events_url":"https://api.github.com/users/uday-mshr/events{/privacy}","received_events_url":"https://api.github.com/users/uday-mshr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-09-21T06:18:54Z","updated_at":"2016-09-21T23:10:22Z","closed_at":null,"body":"my JSON Respose is \r\n{\r\n    code = 1;\r\n    document =     (\r\n                {\r\n            Address1 = \"<null>\";\r\n            Address2 = \"<null>\";\r\n            City = \"<null>\";\r\n            CompanyID = 1;\r\n            CompanyName = Innohabit;\r\n            ContactNumber = \"<null>\";\r\n            Designation = \"<null>\";\r\n            DesignationID = 36;\r\n            DesignationName = dev;\r\n            Email = \"uday.mishra@Gmail.com\";\r\n            FCMRegistrationToken = \"\";\r\n            GCMRegistrationToken = \"\";\r\n            Gender = Male;\r\n            ID = 9;\r\n            IsActive = 1;\r\n            IsFirstLogin = 1;\r\n            LastLogin = \"2016-09-21 05:45:33\";\r\n            Name = \"Uday Mishra\";\r\n            Password = \"\";\r\n            ProfilePic = \"\";\r\n            RegisterationDate = \"2016-03-04 07:42:42\";\r\n            UserTwitter = \"<null>\";\r\n            Username = \"uday.mishra@Gmail.com\";\r\n        }\r\n    );\r\n    message = \"Record found\";\r\n    status = success;\r\n}\r\n\r\nAnd Trying to Convert the respose using Swifty Json Like this \r\n\r\n                case .success:\r\n                print(response)\r\n                \r\n                let jsonResponse = JSON(response.data)\r\n                print(\"JSON\")\r\n                let jsonData = jsonResponse[\"document\"]\r\n                print(jsonResponse)\r\n                print(jsonData[0])\r\n\r\nBut I am Not getting the desired result, the Output is \r\n`{\r\n    code = 1;\r\n    document =     (\r\n                {\r\n            Address1 = \"<null>\";\r\n            Address2 = \"<null>\";\r\n            City = \"<null>\";\r\n            CompanyID = 1;\r\n            CompanyName = Innohabit;\r\n            ContactNumber = \"<null>\";\r\n            Designation = \"<null>\";\r\n            DesignationID = 36;\r\n            DesignationName = dev;\r\n            Email = \"uday.mishra@Gmail.com\";\r\n            FCMRegistrationToken = \"\";\r\n            GCMRegistrationToken = \"\";\r\n            Gender = Male;\r\n            ID = 9;\r\n            IsActive = 1;\r\n            IsFirstLogin = 1;\r\n            LastLogin = \"2016-09-21 05:45:33\";\r\n            Name = \"Uday Mishra\";\r\n            Password = \"\";\r\n            ProfilePic = \"\";\r\n            RegisterationDate = \"2016-03-04 07:42:42\";\r\n            UserTwitter = \"<null>\";\r\n            Username = \"uday.mishra@Gmail.com\";\r\n        }\r\n    );\r\n    message = \"Record found\";\r\n    status = success;\r\n}\r\nJSON\r\nunknown\r\nnull`\r\n\r\nAs u can see the response is getting printed ,but the **print(jsonResponse)** and  **print(jsonData[0])**\r\nis printing  **Unknown** and **null** can anyone help me how i can serialise the data properly into JSON format from DataRespose<any>\r\n \r\n"},"comment":{"url":"https://api.github.com/repos/SwiftyJSON/SwiftyJSON/issues/comments/248769927","html_url":"https://github.com/SwiftyJSON/SwiftyJSON/issues/638#issuecomment-248769927","issue_url":"https://api.github.com/repos/SwiftyJSON/SwiftyJSON/issues/638","id":248769927,"user":{"login":"Vkt0r","id":4573453,"avatar_url":"https://avatars.githubusercontent.com/u/4573453?v=3","gravatar_id":"","url":"https://api.github.com/users/Vkt0r","html_url":"https://github.com/Vkt0r","followers_url":"https://api.github.com/users/Vkt0r/followers","following_url":"https://api.github.com/users/Vkt0r/following{/other_user}","gists_url":"https://api.github.com/users/Vkt0r/gists{/gist_id}","starred_url":"https://api.github.com/users/Vkt0r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Vkt0r/subscriptions","organizations_url":"https://api.github.com/users/Vkt0r/orgs","repos_url":"https://api.github.com/users/Vkt0r/repos","events_url":"https://api.github.com/users/Vkt0r/events{/privacy}","received_events_url":"https://api.github.com/users/Vkt0r/received_events","type":"User","site_admin":false},"created_at":"2016-09-21T23:10:22Z","updated_at":"2016-09-21T23:10:22Z","body":"Are you using Alamofire? Because if it's the case and you're calling for example another response handler distinct of `responseJSON` then you cannot call the initializer `JSON(response.data)` of SwiftyJSON as you did in your code, you need to call:\r\n\r\n    JSON(data: dataFromNetworking) \r\n\r\nas @zhigang1992 proposed above or \r\n\r\n    if let dataFromString = jsonString.dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false) {\r\n         let json = JSON(data: dataFromString)\r\n    }\r\n\r\nIn case your JSON come as a `String` object in case you use `responseString` from Alamofire"}}
{"actor":{"display_login":"Vkt0r"}}