jsonapify
jsonapify copied to clipboard
JSON Patch spec compliance
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 You're right. This will be fixed in next version