trikoder/trim

JSON API spec violation when updating a resource

Closed this issue · 1 comments

JSON API update resource specification

A resource can be updated by sending a PATCH request to the URL that represents the resource.

The JSON API specification states that the resource should be updated using a PATCH request. The CMF uses PUT instead which is a clear violation of the specification and because of it the CMF can't be used as-is with any JSON API compliant backend library, even though the CMF claims to speak "JSON API".

Example of a Laravel JSON API compliant backend library (and the routes it creates for a JSON API resource, notice that "PATCH" is used for updating the resource):

https://laravel-json-api.readthedocs.io/en/latest/basics/routing/#resource-routes

@X-Coder264 Support for patch method when doing resource update is now available (0.52 release).
Set 'usePatchForUpdate' boot data property before starting your application.

app.setBootData({
    ...
    usePatchForUpdate: true,
    ...
});
...
app.start();