Closed nohponex closed 8 years ago
See http://jsonapi.org/format/#crud-updating-resource-relationships
For instance, the following PATCH request will update the author relationship of an article:
PATCH /articles/1 HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { "data": { "type": "articles", "id": "1", "relationships": { "author": { "data": { "type": "people", "id": "1" } } } } }
Likewise, the following PATCH request performs a complete replacement of the tags for an article:
PATCH /articles/1 HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { "data": { "type": "articles", "id": "1", "relationships": { "tags": { "data": [ { "type": "tags", "id": "2" }, { "type": "tags", "id": "3" } ] } } } }
A bit of code in the preview tab please :-)
Implemented at 1.0.0-RC2
See http://jsonapi.org/format/#crud-updating-resource-relationships
For instance, the following PATCH request will update the author relationship of an article:
Likewise, the following PATCH request performs a complete replacement of the tags for an article: