{"action":"closed","issue":{"url":"https://api.github.com/repos/fge/json-patch/issues/34","repository_url":"https://api.github.com/repos/fge/json-patch","labels_url":"https://api.github.com/repos/fge/json-patch/issues/34/labels{/name}","comments_url":"https://api.github.com/repos/fge/json-patch/issues/34/comments","events_url":"https://api.github.com/repos/fge/json-patch/issues/34/events","html_url":"https://github.com/fge/json-patch/issues/34","id":133275724,"number":34,"title":"Problem with ObjectIds","user":{"login":"heruan","id":851745,"avatar_url":"https://avatars.githubusercontent.com/u/851745?v=3","gravatar_id":"","url":"https://api.github.com/users/heruan","html_url":"https://github.com/heruan","followers_url":"https://api.github.com/users/heruan/followers","following_url":"https://api.github.com/users/heruan/following{/other_user}","gists_url":"https://api.github.com/users/heruan/gists{/gist_id}","starred_url":"https://api.github.com/users/heruan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heruan/subscriptions","organizations_url":"https://api.github.com/users/heruan/orgs","repos_url":"https://api.github.com/users/heruan/repos","events_url":"https://api.github.com/users/heruan/events{/privacy}","received_events_url":"https://api.github.com/users/heruan/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-02-12T15:56:32Z","updated_at":"2016-02-13T09:38:46Z","closed_at":"2016-02-13T09:38:46Z","body":"Patching and deserializing object annotated with `JsonIdentityInfo` may fail when duplicate ids occur. For example, given a JSON source:\r\n```json\r\n{\r\n    \"@id\": 123,\r\n    \"name\": \"John\",\r\n    \"dog\": { \"@id\": 456, \"name\": \"Buddy\" },\r\n    \"cat\": { \"@id\": 789, \"name\": \"Rover\" },\r\n    \"favoritePet\": 456\r\n}\r\n```\r\napplying\r\n```json\r\n[ {\r\n    \"op\": \"replace\",\r\n    \"path\": \"/favoritePet\",\r\n    \"value\": { \"@id\": 789, \"name\": \"Rover\" }\r\n} ]\r\n```\r\nwill result in\r\n```json\r\n{\r\n    \"@id\": 123,\r\n    \"name\": \"John\",\r\n    \"dog\": { \"@id\": 456, \"name\": \"Buddy\" },\r\n    \"cat\": { \"@id\": 789, \"name\": \"Rover\" },\r\n    \"favoritePet\": { \"@id\": 789, \"name\": \"Rover\" }\r\n}\r\n```\r\nand deserializing with Jackson will fail with:\r\n```\r\nJsonMappingException: Already had POJO for id '789'\r\n```\r\nThe patch is applied correctly, but it cannot be deserialized as a side effect of duplicated ObjectIds. Id would be useful to have JsonPatch recognize ObjectIds and use them if the patched JSON already contains one."}}