{"action":"closed","issue":{"url":"https://api.github.com/repos/olafura/json_diff_ex/issues/1","repository_url":"https://api.github.com/repos/olafura/json_diff_ex","labels_url":"https://api.github.com/repos/olafura/json_diff_ex/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/olafura/json_diff_ex/issues/1/comments","events_url":"https://api.github.com/repos/olafura/json_diff_ex/issues/1/events","html_url":"https://github.com/olafura/json_diff_ex/issues/1","id":175517529,"number":1,"title":"Patching a map with different keys","user":{"login":"fdorothy","id":999829,"avatar_url":"https://avatars.githubusercontent.com/u/999829?v=3","gravatar_id":"","url":"https://api.github.com/users/fdorothy","html_url":"https://github.com/fdorothy","followers_url":"https://api.github.com/users/fdorothy/followers","following_url":"https://api.github.com/users/fdorothy/following{/other_user}","gists_url":"https://api.github.com/users/fdorothy/gists{/gist_id}","starred_url":"https://api.github.com/users/fdorothy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fdorothy/subscriptions","organizations_url":"https://api.github.com/users/fdorothy/orgs","repos_url":"https://api.github.com/users/fdorothy/repos","events_url":"https://api.github.com/users/fdorothy/events{/privacy}","received_events_url":"https://api.github.com/users/fdorothy/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-07T14:29:37Z","updated_at":"2016-09-12T13:36:51Z","closed_at":"2016-09-12T13:36:51Z","body":"I'm not sure if this is supported, but I tried calculating a diff for two maps with different keys. The diff produced something, but applying the patch caused a CaseClauseError.\r\n\r\n> \r\n> iex(9)> p = JsonDiffEx.diff(%{\"foo\" => 1}, %{\"bar\" => 3})\r\n> %{\"bar\" => [3], \"foo\" => [1, 0, 0]}\r\n> iex(10)> JsonDiffEx.patch(%{\"foo\" => 1}, p)\r\n> ** (CaseClauseError) no case clause matching: [1, 0, 0]\r\n>              lib/json_diff_ex.ex:244: anonymous fn/3 in JsonDiffEx.do_patch/2\r\n>     (elixir) lib/map.ex:362: Map.update/4\r\n>     (stdlib) lists.erl:1262: :lists.foldl/3\r\n\r\nI was expected this to produce a map like %{\"foo\" => 1, \"bar\" => 3}. Is this not supported?"}}
{"actor":{"display_login":"olafura"}}