{"action":"opened","issue":{"url":"https://api.github.com/repos/prisa1987/ShowTimeDemo/issues/7","labels_url":"https://api.github.com/repos/prisa1987/ShowTimeDemo/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/prisa1987/ShowTimeDemo/issues/7/comments","events_url":"https://api.github.com/repos/prisa1987/ShowTimeDemo/issues/7/events","html_url":"https://github.com/prisa1987/ShowTimeDemo/issues/7","id":75096029,"number":7,"title":"Using GSON to do JSON Serialization","user":{"login":"VerachadW","id":5153555,"avatar_url":"https://avatars.githubusercontent.com/u/5153555?v=3","gravatar_id":"","url":"https://api.github.com/users/VerachadW","html_url":"https://github.com/VerachadW","followers_url":"https://api.github.com/users/VerachadW/followers","following_url":"https://api.github.com/users/VerachadW/following{/other_user}","gists_url":"https://api.github.com/users/VerachadW/gists{/gist_id}","starred_url":"https://api.github.com/users/VerachadW/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VerachadW/subscriptions","organizations_url":"https://api.github.com/users/VerachadW/orgs","repos_url":"https://api.github.com/users/VerachadW/repos","events_url":"https://api.github.com/users/VerachadW/events{/privacy}","received_events_url":"https://api.github.com/users/VerachadW/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-05-11T05:40:53Z","updated_at":"2015-05-11T05:40:53Z","closed_at":null,"body":"Instead of doing the utility function by yourself. You should take a look at open-source library first. e.g. [Gson](https://github.com/google/gson) from Google is one of the best library to do JSON Serialization/Deserialization. For example, if we have \r\n```\r\n{\r\n    \"name\": \"John Smith\"\r\n    \"position\": \"Android Developer\"\r\n    \"email\": \"john.s@taskworld.com\"\r\n    \"age\": 30\r\n}\r\n```\r\nWe can write a model class as below\r\n```\r\nclass Employee {\r\n    var name: String? = null\r\n    var position: String? = null\r\n    var email: String? = null\r\n    var age: Int = 0\r\n}\r\n```\r\nAnd we just write a simple code to serialize from JSON string to object.\r\n```\r\nval gson = Gson()\r\nval employee = gson.fromJson(jsonString)\r\n```\r\n\r\nPlease try to use it. :+1: "}}