{"action":"created","issue":{"url":"https://api.github.com/repos/jhalterman/modelmapper/issues/159","labels_url":"https://api.github.com/repos/jhalterman/modelmapper/issues/159/labels{/name}","comments_url":"https://api.github.com/repos/jhalterman/modelmapper/issues/159/comments","events_url":"https://api.github.com/repos/jhalterman/modelmapper/issues/159/events","html_url":"https://github.com/jhalterman/modelmapper/issues/159","id":106171086,"number":159,"title":"Support for circular dependencies? No mention in documentation","user":{"login":"richardkabiling","id":2498349,"avatar_url":"https://avatars.githubusercontent.com/u/2498349?v=3","gravatar_id":"","url":"https://api.github.com/users/richardkabiling","html_url":"https://github.com/richardkabiling","followers_url":"https://api.github.com/users/richardkabiling/followers","following_url":"https://api.github.com/users/richardkabiling/following{/other_user}","gists_url":"https://api.github.com/users/richardkabiling/gists{/gist_id}","starred_url":"https://api.github.com/users/richardkabiling/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richardkabiling/subscriptions","organizations_url":"https://api.github.com/users/richardkabiling/orgs","repos_url":"https://api.github.com/users/richardkabiling/repos","events_url":"https://api.github.com/users/richardkabiling/events{/privacy}","received_events_url":"https://api.github.com/users/richardkabiling/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-12T16:39:32Z","updated_at":"2015-09-13T02:43:33Z","closed_at":"2015-09-13T02:43:10Z","body":"There seems to be support for circular dependencies based on following issue: #2, #15 , #64 but I can't seem to find any mention of this in the documentation.\r\n\r\nHow do I do this? The following code causes a StackOverflowError\r\n\r\n\tpublic static void main(String[] args) {\r\n\t\t\r\n\t\tPerson parent = new Person();\r\n\t\tparent.setId(1);\r\n\t\tparent.setName(\"Richard\");\r\n\t\t\r\n\t\tChild child1 = new Child();\r\n\t\tparent.setId(1);\r\n\t\tchild1.setName(\"Chad\");\r\n\t\tchild1.setParent(parent);\r\n\t\t\r\n\t\tChild child2 = new Child();\r\n\t\tparent.setId(2);\r\n\t\tchild2.setName(\"Rich\");\r\n\t\tchild2.setParent(parent);\r\n\t\t\r\n\t\tChild child3 = new Child();\r\n\t\tparent.setId(3);\r\n\t\tchild3.setName(\"Kevin\");\r\n\t\tchild3.setParent(parent);\r\n\t\t\r\n\t\tparent.setChildren(Arrays.asList(child1, child2, child3));\r\n\t\t\r\n\t\tModelMapper mapper = new ModelMapper();\r\n\t\tPersonResource personResource = mapper.map(parent, PersonResource.class);\r\n\t\tSystem.out.println(personResource);\r\n\t}"},"comment":{"url":"https://api.github.com/repos/jhalterman/modelmapper/issues/comments/139840432","html_url":"https://github.com/jhalterman/modelmapper/issues/159#issuecomment-139840432","issue_url":"https://api.github.com/repos/jhalterman/modelmapper/issues/159","id":139840432,"user":{"login":"richardkabiling","id":2498349,"avatar_url":"https://avatars.githubusercontent.com/u/2498349?v=3","gravatar_id":"","url":"https://api.github.com/users/richardkabiling","html_url":"https://github.com/richardkabiling","followers_url":"https://api.github.com/users/richardkabiling/followers","following_url":"https://api.github.com/users/richardkabiling/following{/other_user}","gists_url":"https://api.github.com/users/richardkabiling/gists{/gist_id}","starred_url":"https://api.github.com/users/richardkabiling/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richardkabiling/subscriptions","organizations_url":"https://api.github.com/users/richardkabiling/orgs","repos_url":"https://api.github.com/users/richardkabiling/repos","events_url":"https://api.github.com/users/richardkabiling/events{/privacy}","received_events_url":"https://api.github.com/users/richardkabiling/received_events","type":"User","site_admin":false},"created_at":"2015-09-13T02:43:33Z","updated_at":"2015-09-13T02:43:33Z","body":"Seems the circular reference issue was caused by a different issue."}}