{"action":"created","issue":{"url":"https://api.github.com/repos/immutables/immutables/issues/666","repository_url":"https://api.github.com/repos/immutables/immutables","labels_url":"https://api.github.com/repos/immutables/immutables/issues/666/labels{/name}","comments_url":"https://api.github.com/repos/immutables/immutables/issues/666/comments","events_url":"https://api.github.com/repos/immutables/immutables/issues/666/events","html_url":"https://github.com/immutables/immutables/issues/666","id":248256720,"node_id":"MDU6SXNzdWUyNDgyNTY3MjA=","number":666,"title":"Immutable with Jackson annotation @JsonIdentityInfo not working during deserialization","user":{"login":"mquinrod","id":16209781,"node_id":"MDQ6VXNlcjE2MjA5Nzgx","avatar_url":"https://avatars1.githubusercontent.com/u/16209781?v=4","gravatar_id":"","url":"https://api.github.com/users/mquinrod","html_url":"https://github.com/mquinrod","followers_url":"https://api.github.com/users/mquinrod/followers","following_url":"https://api.github.com/users/mquinrod/following{/other_user}","gists_url":"https://api.github.com/users/mquinrod/gists{/gist_id}","starred_url":"https://api.github.com/users/mquinrod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mquinrod/subscriptions","organizations_url":"https://api.github.com/users/mquinrod/orgs","repos_url":"https://api.github.com/users/mquinrod/repos","events_url":"https://api.github.com/users/mquinrod/events{/privacy}","received_events_url":"https://api.github.com/users/mquinrod/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-08-06T16:20:36Z","updated_at":"2018-09-19T20:33:06Z","closed_at":null,"author_association":"NONE","body":"Using Immutables Value 2.5.6 and Jackson 2.9.0.pr4 I get an UnsupportedOperationException for references resolved by JsonIdentityInfo.\r\n\r\nImmutable class:\r\n```\r\n@JsonIdentityInfo(generator = PropertyGenerator.class, property = \"name\")\r\n@JsonDeserialize(as = ImmutableExample.class)\r\n@JsonSerialize(as = ImmutableExample.class)\r\n@Value.Immutable\r\npublic abstract class Example {\r\n\r\n  private final String name = \"\";\r\n\r\n  @Value.Default\r\n  public String getName() {\r\n    return name;\r\n  }\r\n\r\n  public abstract List<Example> getRef();\r\n}\r\n```\r\nTest:\r\n```\r\n@Test\r\npublic void example() throws Exception {\r\n  \r\n  final ObjectMapper mapper = new ObjectMapper();\r\n  mapper.registerModule(new GuavaModule());\r\n  \r\n  /*\r\n   * {\r\n   *   \"name\" : \"A\",\r\n   *   \"ref\" : [ {\r\n   *     \"name\" : \"C\",\r\n   *     \"ref\" : [ ]\r\n   *   }, {\r\n   *     \"name\" : \"B\",\r\n   *     \"ref\" : [ \"C\" ]\r\n   *   } ]\r\n   * }\r\n   */\r\n  final String serialized =\r\n     \"{  \"\r\n   + \"  \\\"name\\\" : \\\"A\\\",\"\r\n   + \"  \\\"ref\\\" : [ {\"\r\n   + \"    \\\"name\\\" : \\\"C\\\",\"\r\n   + \"    \\\"ref\\\" : [ ]\"\r\n   + \"  }, {\"\r\n   + \"    \\\"name\\\" : \\\"B\\\",\"\r\n   + \"    \\\"ref\\\" : [ \\\"C\\\" ]\"\r\n   + \"  } ]\"\r\n   + \"}\";\r\n  \r\n  final Example deserialized = mapper.readValue(serialized, Example.class);\r\n  \r\n  Assert.assertEquals(\"C\", deserialized.getRef().get(1).getRef().get(0).getName());\r\n}\r\n```\r\nThe ref to C into element B is resolved as `ImmutableExample$Json` which always throws UnsupportedOperationException when invoked.\r\n\r\nKind regards."},"comment":{"url":"https://api.github.com/repos/immutables/immutables/issues/comments/422948299","html_url":"https://github.com/immutables/immutables/issues/666#issuecomment-422948299","issue_url":"https://api.github.com/repos/immutables/immutables/issues/666","id":422948299,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMjk0ODI5OQ==","user":{"login":"a5phyx","id":30180965,"node_id":"MDQ6VXNlcjMwMTgwOTY1","avatar_url":"https://avatars0.githubusercontent.com/u/30180965?v=4","gravatar_id":"","url":"https://api.github.com/users/a5phyx","html_url":"https://github.com/a5phyx","followers_url":"https://api.github.com/users/a5phyx/followers","following_url":"https://api.github.com/users/a5phyx/following{/other_user}","gists_url":"https://api.github.com/users/a5phyx/gists{/gist_id}","starred_url":"https://api.github.com/users/a5phyx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/a5phyx/subscriptions","organizations_url":"https://api.github.com/users/a5phyx/orgs","repos_url":"https://api.github.com/users/a5phyx/repos","events_url":"https://api.github.com/users/a5phyx/events{/privacy}","received_events_url":"https://api.github.com/users/a5phyx/received_events","type":"User","site_admin":false},"created_at":"2018-09-19T20:33:06Z","updated_at":"2018-09-19T20:33:06Z","author_association":"NONE","body":"The workaround can be found there: https://github.com/FasterXML/jackson-databind/issues/1706#issuecomment-422446168"}}
{"actor":{"display_login":"a5phyx"}}