{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/JsonPatch/issues/48","repository_url":"https://api.github.com/repos/aspnet/JsonPatch","labels_url":"https://api.github.com/repos/aspnet/JsonPatch/issues/48/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/JsonPatch/issues/48/comments","events_url":"https://api.github.com/repos/aspnet/JsonPatch/issues/48/events","html_url":"https://github.com/aspnet/JsonPatch/issues/48","id":189977713,"number":48,"title":"Simple add on Lists failing in 1.1.0+","user":{"login":"PartyArk","id":1035220,"avatar_url":"https://avatars.githubusercontent.com/u/1035220?v=3","gravatar_id":"","url":"https://api.github.com/users/PartyArk","html_url":"https://github.com/PartyArk","followers_url":"https://api.github.com/users/PartyArk/followers","following_url":"https://api.github.com/users/PartyArk/following{/other_user}","gists_url":"https://api.github.com/users/PartyArk/gists{/gist_id}","starred_url":"https://api.github.com/users/PartyArk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PartyArk/subscriptions","organizations_url":"https://api.github.com/users/PartyArk/orgs","repos_url":"https://api.github.com/users/PartyArk/repos","events_url":"https://api.github.com/users/PartyArk/events{/privacy}","received_events_url":"https://api.github.com/users/PartyArk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-17T08:44:41Z","updated_at":"2016-11-17T09:09:19Z","closed_at":null,"body":"Working on 1.0.0, but failing on 1.1.0 and 1.2.0-preview1-22759\r\n\r\nHere I'm attempting to add a new entry on List named Mylist which already has two entries (at indexes zero and one)\r\n\r\n`[{\"op\":\"add\",\"path\":\"/mylist/2\",\"value\":{\"myname\":\"foo\",\"age\":33}}]`\r\n\r\nResponse:\r\nJsonPatchException: The index value provided by path segment '2' is out of bounds of the array size.\r\n\r\nI'm guessing it's incorrectly looking at the length of the list prior to adding.\r\n"},"comment":{"url":"https://api.github.com/repos/aspnet/JsonPatch/issues/comments/261193143","html_url":"https://github.com/aspnet/JsonPatch/issues/48#issuecomment-261193143","issue_url":"https://api.github.com/repos/aspnet/JsonPatch/issues/48","id":261193143,"user":{"login":"PartyArk","id":1035220,"avatar_url":"https://avatars.githubusercontent.com/u/1035220?v=3","gravatar_id":"","url":"https://api.github.com/users/PartyArk","html_url":"https://github.com/PartyArk","followers_url":"https://api.github.com/users/PartyArk/followers","following_url":"https://api.github.com/users/PartyArk/following{/other_user}","gists_url":"https://api.github.com/users/PartyArk/gists{/gist_id}","starred_url":"https://api.github.com/users/PartyArk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PartyArk/subscriptions","organizations_url":"https://api.github.com/users/PartyArk/orgs","repos_url":"https://api.github.com/users/PartyArk/repos","events_url":"https://api.github.com/users/PartyArk/events{/privacy}","received_events_url":"https://api.github.com/users/PartyArk/received_events","type":"User","site_admin":false},"created_at":"2016-11-17T09:09:19Z","updated_at":"2016-11-17T09:09:19Z","body":"The specification says:\r\n\r\n   o  An element to add to an existing array - whereupon the supplied\r\n      value is added to the array at the indicated location.  Any\r\n      elements at or above the specified index are shifted one position\r\n      to the right.  The specified index MUST NOT be greater than the\r\n      number of elements in the array.  If the \"-\" character is used to\r\n      index the end of the array (see [RFC6901]), this has the effect of\r\n      appending the value to the array.\r\n\r\nSo if we have a list with 2 items, an _index_ of 2 is conformant because it it _not greater_ than the number of elements in the array, and also it implies the same thing as \"-\" ie. it should add to the end of the array. \r\n\r\nWe use the popular fast-json js library, where this same issue has been discussed - https://github.com/Starcounter-Jack/JSON-Patch/issues/78\r\n\r\n\r\n\r\n"}}
{"actor":{"display_login":"PartyArk"}}