json-patch / json-patch-tests

Tests for implementations of json-patch
68 stars 21 forks source link

Integers can be array indicies, but are also valid object element names #2

Closed c799878 closed 11 years ago

c799878 commented 11 years ago

In tests.json

WRONG { "doc": {"foo": 1}, "patch": [{"op": "add", "path": "/0", "value": "bar"}], "error": "Array operation on object target" },

RIGHT { "comment": "0 can be an array index or object element name", "doc": {"foo": 1}, "patch": [{"op": "add", "path": "/0", "value": "bar"}], "expected": {"foo": 1, "0": "bar" },