jsonapify icon indicating copy to clipboard operation
jsonapify copied to clipboard

JSON Patch spec compliance

Open hkosiacki opened this issue 8 years ago • 1 comments

Correct me if I'm wrong, but it seems to me that the modify middleware expects request body in a different form than the one described in the extension specification.

The example from the spec (there is no object wrapping the op array):

[
  { "op": "replace", "path": "/src", "value": "http://example.com/hamster.png" }
]

The way modify expects it:

{
  "data": [
    { "op": "replace", "path": "/attributes/src", "value": "http://example.com/hamster.png" }
  ]
}

As far as I understood, prefixing modified field's path with "/attributes" shouldn't be required, as attributes and relationships cannot have identically named fields. Extension spec also mentions that the request URL and operation's path combined must form a valid path to a collection or a (sub)resource.

hkosiacki avatar Mar 04 '16 02:03 hkosiacki

@hkosiacki You're right. This will be fixed in next version

alex94cp avatar Mar 12 '16 01:03 alex94cp