{"action":"created","issue":{"url":"https://api.github.com/repos/voryx/restgeneratorbundle/issues/16","labels_url":"https://api.github.com/repos/voryx/restgeneratorbundle/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/voryx/restgeneratorbundle/issues/16/comments","events_url":"https://api.github.com/repos/voryx/restgeneratorbundle/issues/16/events","html_url":"https://github.com/voryx/restgeneratorbundle/issues/16","id":57239870,"number":16,"title":"Doesn't work with bidrectional associations","user":{"login":"Clindbergh","id":2742027,"avatar_url":"https://avatars.githubusercontent.com/u/2742027?v=3","gravatar_id":"","url":"https://api.github.com/users/Clindbergh","html_url":"https://github.com/Clindbergh","followers_url":"https://api.github.com/users/Clindbergh/followers","following_url":"https://api.github.com/users/Clindbergh/following{/other_user}","gists_url":"https://api.github.com/users/Clindbergh/gists{/gist_id}","starred_url":"https://api.github.com/users/Clindbergh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Clindbergh/subscriptions","organizations_url":"https://api.github.com/users/Clindbergh/orgs","repos_url":"https://api.github.com/users/Clindbergh/repos","events_url":"https://api.github.com/users/Clindbergh/events{/privacy}","received_events_url":"https://api.github.com/users/Clindbergh/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-02-10T21:30:35Z","updated_at":"2015-02-11T13:06:22Z","closed_at":"2015-02-11T13:06:22Z","body":"On a GET request, the related entities of the requested entity are recursively fetched. If I have an unidirectional relationship like:\r\n```\r\nauthor(id, name, books), book(id, name)\r\n```\r\nthis works fine:\r\n```\r\napi/author/1: { id: 1, name: \"MyName\", books: [{ id: 1, name: \"FuzzyBook\" }] }\r\n```\r\nBut if the related entity (book in this case) has a backreference (=> bidirectional association) to the other entity (author), this fails (infinite recursion).\r\n\r\nTo avoid this, wouldn't it be nice if only the ids of the related entities (1st level only) were fetched? Maybe with a switch (\"--use-id-for-children\") while generating the api."},"comment":{"url":"https://api.github.com/repos/voryx/restgeneratorbundle/issues/comments/73877723","html_url":"https://github.com/voryx/restgeneratorbundle/issues/16#issuecomment-73877723","issue_url":"https://api.github.com/repos/voryx/restgeneratorbundle/issues/16","id":73877723,"user":{"login":"davidwdan","id":4969183,"avatar_url":"https://avatars.githubusercontent.com/u/4969183?v=3","gravatar_id":"","url":"https://api.github.com/users/davidwdan","html_url":"https://github.com/davidwdan","followers_url":"https://api.github.com/users/davidwdan/followers","following_url":"https://api.github.com/users/davidwdan/following{/other_user}","gists_url":"https://api.github.com/users/davidwdan/gists{/gist_id}","starred_url":"https://api.github.com/users/davidwdan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidwdan/subscriptions","organizations_url":"https://api.github.com/users/davidwdan/orgs","repos_url":"https://api.github.com/users/davidwdan/repos","events_url":"https://api.github.com/users/davidwdan/events{/privacy}","received_events_url":"https://api.github.com/users/davidwdan/received_events","type":"User","site_admin":false},"created_at":"2015-02-11T13:06:22Z","updated_at":"2015-02-11T13:06:22Z","body":"@Clindbergh I'm going to close this issue.  I'll reopen if you're still having issues."}}