{"action":"created","issue":{"url":"https://api.github.com/repos/wbish/jsondiffpatch.net/issues/16","repository_url":"https://api.github.com/repos/wbish/jsondiffpatch.net","labels_url":"https://api.github.com/repos/wbish/jsondiffpatch.net/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/wbish/jsondiffpatch.net/issues/16/comments","events_url":"https://api.github.com/repos/wbish/jsondiffpatch.net/issues/16/events","html_url":"https://github.com/wbish/jsondiffpatch.net/issues/16","id":274999838,"number":16,"title":"Unpatch throws exception","user":{"login":"npfrizze","id":33757351,"avatar_url":"https://avatars0.githubusercontent.com/u/33757351?v=4","gravatar_id":"","url":"https://api.github.com/users/npfrizze","html_url":"https://github.com/npfrizze","followers_url":"https://api.github.com/users/npfrizze/followers","following_url":"https://api.github.com/users/npfrizze/following{/other_user}","gists_url":"https://api.github.com/users/npfrizze/gists{/gist_id}","starred_url":"https://api.github.com/users/npfrizze/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/npfrizze/subscriptions","organizations_url":"https://api.github.com/users/npfrizze/orgs","repos_url":"https://api.github.com/users/npfrizze/repos","events_url":"https://api.github.com/users/npfrizze/events{/privacy}","received_events_url":"https://api.github.com/users/npfrizze/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-11-17T21:20:41Z","updated_at":"2017-11-17T21:52:41Z","closed_at":null,"author_association":"NONE","body":"Using the attached files, I am unable to 'Unpatch' a file.  While the json is fairly complex, the changes are not that complex.  Is this a bug?\r\n\r\nexception - **Index is equal to or greater than Count.\r\nParameter name: index**\r\n\r\nstring modifiedJson = File.ReadAllText($\"c:/temp/modified.json\");\r\nstring defaultJson = File.ReadAllText($\"c:/temp/default.json\");\r\n\r\nJsonDiffPatch jsonDiffPatch = new JsonDiffPatch();\r\nvar patch = jsonDiffPatch.Diff(modifiedJson, defaultJson);\r\n\r\nConsole.WriteLine(\"patch\" + patch);\r\n\r\ntry\r\n{\r\n  string patched = jsonDiffPatch.Unpatch(defaultJson, patch);\r\n  Console.WriteLine(\"patched\" + patched);\r\n}\r\ncatch (Exception ex)\r\n{\r\n  Console.WriteLine(\"exception\" + ex.Message);\r\n}\r\n[default.txt](https://github.com/wbish/jsondiffpatch.net/files/1483874/default.txt)\r\n[modified.txt](https://github.com/wbish/jsondiffpatch.net/files/1483875/modified.txt)\r\n"},"comment":{"url":"https://api.github.com/repos/wbish/jsondiffpatch.net/issues/comments/345375751","html_url":"https://github.com/wbish/jsondiffpatch.net/issues/16#issuecomment-345375751","issue_url":"https://api.github.com/repos/wbish/jsondiffpatch.net/issues/16","id":345375751,"user":{"login":"npfrizze","id":33757351,"avatar_url":"https://avatars0.githubusercontent.com/u/33757351?v=4","gravatar_id":"","url":"https://api.github.com/users/npfrizze","html_url":"https://github.com/npfrizze","followers_url":"https://api.github.com/users/npfrizze/followers","following_url":"https://api.github.com/users/npfrizze/following{/other_user}","gists_url":"https://api.github.com/users/npfrizze/gists{/gist_id}","starred_url":"https://api.github.com/users/npfrizze/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/npfrizze/subscriptions","organizations_url":"https://api.github.com/users/npfrizze/orgs","repos_url":"https://api.github.com/users/npfrizze/repos","events_url":"https://api.github.com/users/npfrizze/events{/privacy}","received_events_url":"https://api.github.com/users/npfrizze/received_events","type":"User","site_admin":false},"created_at":"2017-11-17T21:52:41Z","updated_at":"2017-11-17T21:52:41Z","author_association":"NONE","body":"I am also seeing an issue with these 2 files.  \r\nIt doesn't throw an exception, but the unpatched file is not correct.\r\n\r\n[modified.txt](https://github.com/wbish/jsondiffpatch.net/files/1483947/modified.txt)\r\n[default.txt](https://github.com/wbish/jsondiffpatch.net/files/1483948/default.txt)\r\n\r\n"}}
{"actor":{"display_login":"npfrizze"}}