{"action":"created","issue":{"url":"https://api.github.com/repos/mtedone/podam/issues/263","repository_url":"https://api.github.com/repos/mtedone/podam","labels_url":"https://api.github.com/repos/mtedone/podam/issues/263/labels{/name}","comments_url":"https://api.github.com/repos/mtedone/podam/issues/263/comments","events_url":"https://api.github.com/repos/mtedone/podam/issues/263/events","html_url":"https://github.com/mtedone/podam/issues/263","id":316283928,"node_id":"MDU6SXNzdWUzMTYyODM5Mjg=","number":263,"title":"MaxDepth not working with multiple fields","user":{"login":"shollander","id":4641663,"node_id":"MDQ6VXNlcjQ2NDE2NjM=","avatar_url":"https://avatars3.githubusercontent.com/u/4641663?v=4","gravatar_id":"","url":"https://api.github.com/users/shollander","html_url":"https://github.com/shollander","followers_url":"https://api.github.com/users/shollander/followers","following_url":"https://api.github.com/users/shollander/following{/other_user}","gists_url":"https://api.github.com/users/shollander/gists{/gist_id}","starred_url":"https://api.github.com/users/shollander/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shollander/subscriptions","organizations_url":"https://api.github.com/users/shollander/orgs","repos_url":"https://api.github.com/users/shollander/repos","events_url":"https://api.github.com/users/shollander/events{/privacy}","received_events_url":"https://api.github.com/users/shollander/received_events","type":"User","site_admin":false},"labels":[{"id":213640591,"node_id":"MDU6TGFiZWwyMTM2NDA1OTE=","url":"https://api.github.com/repos/mtedone/podam/labels/Not%20An%20Issue","name":"Not An Issue","color":"bfd4f2","default":false}],"state":"open","locked":false,"assignee":{"login":"daivanov","id":1887529,"node_id":"MDQ6VXNlcjE4ODc1Mjk=","avatar_url":"https://avatars3.githubusercontent.com/u/1887529?v=4","gravatar_id":"","url":"https://api.github.com/users/daivanov","html_url":"https://github.com/daivanov","followers_url":"https://api.github.com/users/daivanov/followers","following_url":"https://api.github.com/users/daivanov/following{/other_user}","gists_url":"https://api.github.com/users/daivanov/gists{/gist_id}","starred_url":"https://api.github.com/users/daivanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daivanov/subscriptions","organizations_url":"https://api.github.com/users/daivanov/orgs","repos_url":"https://api.github.com/users/daivanov/repos","events_url":"https://api.github.com/users/daivanov/events{/privacy}","received_events_url":"https://api.github.com/users/daivanov/received_events","type":"User","site_admin":false},"assignees":[{"login":"daivanov","id":1887529,"node_id":"MDQ6VXNlcjE4ODc1Mjk=","avatar_url":"https://avatars3.githubusercontent.com/u/1887529?v=4","gravatar_id":"","url":"https://api.github.com/users/daivanov","html_url":"https://github.com/daivanov","followers_url":"https://api.github.com/users/daivanov/followers","following_url":"https://api.github.com/users/daivanov/following{/other_user}","gists_url":"https://api.github.com/users/daivanov/gists{/gist_id}","starred_url":"https://api.github.com/users/daivanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daivanov/subscriptions","organizations_url":"https://api.github.com/users/daivanov/orgs","repos_url":"https://api.github.com/users/daivanov/repos","events_url":"https://api.github.com/users/daivanov/events{/privacy}","received_events_url":"https://api.github.com/users/daivanov/received_events","type":"User","site_admin":false}],"milestone":null,"comments":9,"created_at":"2018-04-20T14:11:45Z","updated_at":"2018-08-20T15:12:55Z","closed_at":null,"author_association":"NONE","body":"I have an object with the following structure:\r\n```java\r\npublic class MyObject {\r\n    private String name;\r\n    private MyObject related;\r\n    private List<MyObject> children;\r\n}\r\n```\r\n\r\nThe default `maxDepth` setting of `3` is too much for me, I would like the objects to recurse only once (i.e. only `related` and `children` should be populated, but `related.related` and `related.children`, and `children[*].related` and `children[*].children` should be empty. So I created a custom `DataProviderStrategy` and overrode the `getMaxDepth()` method to return `2` instead of the default `3`. As follows:\r\n```java\r\npublic class MyDataProviderStrategy extends AbstractRandomDataProviderStrategy {\r\n   public MyDataProviderStrategy() {\r\n      super.setMemoization(false);\r\n   }\r\n\r\n  @Override\r\n  public int getMaxDepth(Class<?> type) {\r\n    if(MyObject.class.isAssignableFrom(type)) {\r\n      return 2;\r\n    } else {\r\n      return 1;\r\n    }\r\n}\r\n```\r\n\r\n What happened was that the `related` field was correct (only 1 level of recursion), but the `children` field was incorrect. It was always empty even at the top level.\r\n\r\nIt also seems to me that there should be an easier way to configure `maxDepth` than overriding the method. Something like `setMaxDepth(Class<?>, int)` would be helpful."},"comment":{"url":"https://api.github.com/repos/mtedone/podam/issues/comments/414352569","html_url":"https://github.com/mtedone/podam/issues/263#issuecomment-414352569","issue_url":"https://api.github.com/repos/mtedone/podam/issues/263","id":414352569,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNDM1MjU2OQ==","user":{"login":"daivanov","id":1887529,"node_id":"MDQ6VXNlcjE4ODc1Mjk=","avatar_url":"https://avatars3.githubusercontent.com/u/1887529?v=4","gravatar_id":"","url":"https://api.github.com/users/daivanov","html_url":"https://github.com/daivanov","followers_url":"https://api.github.com/users/daivanov/followers","following_url":"https://api.github.com/users/daivanov/following{/other_user}","gists_url":"https://api.github.com/users/daivanov/gists{/gist_id}","starred_url":"https://api.github.com/users/daivanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daivanov/subscriptions","organizations_url":"https://api.github.com/users/daivanov/orgs","repos_url":"https://api.github.com/users/daivanov/repos","events_url":"https://api.github.com/users/daivanov/events{/privacy}","received_events_url":"https://api.github.com/users/daivanov/received_events","type":"User","site_admin":false},"created_at":"2018-08-20T15:12:55Z","updated_at":"2018-08-20T15:12:55Z","author_association":"COLLABORATOR","body":"If you don't mind I will close this issue.\r\n\r\nThanks, Daniil"}}
{"actor":{"display_login":"daivanov"}}