{"action":"created","issue":{"url":"https://api.github.com/repos/Hearst-DD/ObjectMapper/issues/276","labels_url":"https://api.github.com/repos/Hearst-DD/ObjectMapper/issues/276/labels{/name}","comments_url":"https://api.github.com/repos/Hearst-DD/ObjectMapper/issues/276/comments","events_url":"https://api.github.com/repos/Hearst-DD/ObjectMapper/issues/276/events","html_url":"https://github.com/Hearst-DD/ObjectMapper/issues/276","id":114816984,"number":276,"title":"How to manage polymorphic object","user":{"login":"elpic","id":138424,"avatar_url":"https://avatars.githubusercontent.com/u/138424?v=3","gravatar_id":"","url":"https://api.github.com/users/elpic","html_url":"https://github.com/elpic","followers_url":"https://api.github.com/users/elpic/followers","following_url":"https://api.github.com/users/elpic/following{/other_user}","gists_url":"https://api.github.com/users/elpic/gists{/gist_id}","starred_url":"https://api.github.com/users/elpic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elpic/subscriptions","organizations_url":"https://api.github.com/users/elpic/orgs","repos_url":"https://api.github.com/users/elpic/repos","events_url":"https://api.github.com/users/elpic/events{/privacy}","received_events_url":"https://api.github.com/users/elpic/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-11-03T13:35:21Z","updated_at":"2015-11-19T12:15:35Z","closed_at":"2015-11-03T16:26:35Z","body":"On the old version of ObjectMapper, we have a class func called newInstance. That method returns a Mappable object. \r\nI used to use that method to generate the corresponding instance of the type I want.\r\n\r\nFor example: \r\n\r\n```\r\n{\r\n  type: 'a'\r\n}\r\n```\r\n\r\nThis will generate an object of class A\r\n\r\n```\r\n{\r\n  type: 'b'\r\n}\r\n```\r\nThis will generate an object of class B\r\n\r\nA and B are the same API requests.\r\n\r\nHow can I do the same behavior with the new mapping protocol?\r\n\r\nI will appreciate your response.\r\nThanks"},"comment":{"url":"https://api.github.com/repos/Hearst-DD/ObjectMapper/issues/comments/158040889","html_url":"https://github.com/Hearst-DD/ObjectMapper/issues/276#issuecomment-158040889","issue_url":"https://api.github.com/repos/Hearst-DD/ObjectMapper/issues/276","id":158040889,"user":{"login":"elpic","id":138424,"avatar_url":"https://avatars.githubusercontent.com/u/138424?v=3","gravatar_id":"","url":"https://api.github.com/users/elpic","html_url":"https://github.com/elpic","followers_url":"https://api.github.com/users/elpic/followers","following_url":"https://api.github.com/users/elpic/following{/other_user}","gists_url":"https://api.github.com/users/elpic/gists{/gist_id}","starred_url":"https://api.github.com/users/elpic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elpic/subscriptions","organizations_url":"https://api.github.com/users/elpic/orgs","repos_url":"https://api.github.com/users/elpic/repos","events_url":"https://api.github.com/users/elpic/events{/privacy}","received_events_url":"https://api.github.com/users/elpic/received_events","type":"User","site_admin":false},"created_at":"2015-11-19T12:15:35Z","updated_at":"2015-11-19T12:15:35Z","body":"@tristanhimmelman any news on this?"}}