{"action":"created","issue":{"url":"https://api.github.com/repos/pstadler/dtox/issues/6","repository_url":"https://api.github.com/repos/pstadler/dtox","labels_url":"https://api.github.com/repos/pstadler/dtox/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/pstadler/dtox/issues/6/comments","events_url":"https://api.github.com/repos/pstadler/dtox/issues/6/events","html_url":"https://github.com/pstadler/dtox/issues/6","id":191752477,"number":6,"title":"Recursive toJSON function.","user":{"login":"tom-drake","id":23510700,"avatar_url":"https://avatars.githubusercontent.com/u/23510700?v=3","gravatar_id":"","url":"https://api.github.com/users/tom-drake","html_url":"https://github.com/tom-drake","followers_url":"https://api.github.com/users/tom-drake/followers","following_url":"https://api.github.com/users/tom-drake/following{/other_user}","gists_url":"https://api.github.com/users/tom-drake/gists{/gist_id}","starred_url":"https://api.github.com/users/tom-drake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tom-drake/subscriptions","organizations_url":"https://api.github.com/users/tom-drake/orgs","repos_url":"https://api.github.com/users/tom-drake/repos","events_url":"https://api.github.com/users/tom-drake/events{/privacy}","received_events_url":"https://api.github.com/users/tom-drake/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-11-25T18:39:54Z","updated_at":"2016-11-26T14:10:08Z","closed_at":null,"body":"Hi,\r\n\r\nI've been using this library for a while and think its great for mapping my API calls onto a well defined structure. It would be great if I could call toJSON() on a top level DTO and get the full object back as translated. Is this something planned for?\r\n\r\nI can open a pull request with an additional method if this sounds of interest?\r\n\r\nThanks"},"comment":{"url":"https://api.github.com/repos/pstadler/dtox/issues/comments/263065339","html_url":"https://github.com/pstadler/dtox/issues/6#issuecomment-263065339","issue_url":"https://api.github.com/repos/pstadler/dtox/issues/6","id":263065339,"user":{"login":"tom-drake","id":23510700,"avatar_url":"https://avatars.githubusercontent.com/u/23510700?v=3","gravatar_id":"","url":"https://api.github.com/users/tom-drake","html_url":"https://github.com/tom-drake","followers_url":"https://api.github.com/users/tom-drake/followers","following_url":"https://api.github.com/users/tom-drake/following{/other_user}","gists_url":"https://api.github.com/users/tom-drake/gists{/gist_id}","starred_url":"https://api.github.com/users/tom-drake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tom-drake/subscriptions","organizations_url":"https://api.github.com/users/tom-drake/orgs","repos_url":"https://api.github.com/users/tom-drake/repos","events_url":"https://api.github.com/users/tom-drake/events{/privacy}","received_events_url":"https://api.github.com/users/tom-drake/received_events","type":"User","site_admin":false},"created_at":"2016-11-26T14:10:08Z","updated_at":"2016-11-26T14:10:08Z","body":"I'm using dtox (possibly incorrectly) as a sanitation method on APIs which return JSON. In my project I have several DTOs and another which uses them as values.\r\n\r\n```\r\nconst DATA_MAPPING = {\r\n  dtoA: fields.objectWithDTO(DTOA),\r\n  dtoB: fields.objectWithDTO(DTOB),\r\n  dtoC: fields.listWithDTO(DTOC)\r\n};\r\n```\r\nHowever this gives me a top level DTO with classes as values. I was using the `JSON.parse(JSON.stringify(DTOObject))` to remove the class entries such as `dtoObject.dtoA.value...` and rebuild the object how my app would expect it."}}
{"actor":{"display_login":"tom-drake"}}