@@ -27,7 +27,7 @@ operations allowed in this top level array.
27
27
### Request URLs and Patch Paths <a href =" #patch-urls " id =" patch-urls " class =" headerlink " ></a >
28
28
29
29
The request URL and each Patch operation's ` "path" ` are complementary and
30
- ** MUST** combine to target a particular resource, collection, attribute, or
30
+ ** MUST** combine to target a particular resource, collection, resource attribute, or
31
31
relationship.
32
32
33
33
If a server supports the Patch extension, it ** MUST** allow Patch operations at
@@ -65,9 +65,9 @@ Accept: application/vnd.api+json; ext=jsonpatch
65
65
]
66
66
```
67
67
68
- ### Updating Attributes <a href =" #patch-updating-attributes " id =" patch-updating-attributes " class =" headerlink " ></a >
68
+ ### Updating Resource Attributes <a href =" #patch-updating-attributes " id =" patch-updating-attributes " class =" headerlink " ></a >
69
69
70
- To update an attribute, perform a ` "replace" ` operation with the attribute's
70
+ To update a resource attribute, perform a ` "replace" ` operation with the attribute's
71
71
name specified by the ` "path" ` .
72
72
73
73
For instance, the following request should update just the ` src ` property of the
@@ -96,8 +96,7 @@ target a particular relationship's URL.
96
96
#### Updating To-One Relationships <a href =" #patch-updating-to-one-relationships " id =" patch-updating-to-one-relationships " class =" headerlink " ></a >
97
97
98
98
To update a to-one relationship, perform a ` "replace" ` operation with a URL and
99
- ` "path" ` that targets the relationship. The ` "value" ` should be a link object
100
- that contains ` "type" ` and ` "id" ` members.
99
+ ` "path" ` that targets the relationship. The ` "value" ` should be a linkage object.
101
100
102
101
For instance, the following request should update the ` author ` of an article:
103
102
@@ -129,9 +128,8 @@ Accept: application/vnd.api+json; ext=jsonpatch
129
128
A server ** MUST** respond to Patch operations that target a * to-many
130
129
relationship URL* as described below.
131
130
132
- For all operations, the ` "value" ` ** MUST** contain an object that contains
133
- ` type ` and ` id ` members, or an array of objects that each contain ` type `
134
- and ` id ` members.
131
+ For all operations, the ` "value" ` ** MUST** be a linkage object,
132
+ or an array of linkage objects.
135
133
136
134
If a client requests a ` "replace" ` operation to a * to-many relationship URL* , the
137
135
server ** MUST** either completely replace every member of the relationship,
@@ -162,11 +160,12 @@ To add an element to a to-many relationship, request an `"add"` operation that
162
160
targets the relationship's URL. Because the operation is targeting the end of a
163
161
collection, the ` "path" ` must end with ` "/-" ` .
164
162
165
- In the following example, the comment with ID ` 123 ` is added to the list of
166
- comments for the article with ID ` 1 ` :
163
+ In the following example, the new reprint with ID ` 123 ` is added to the list of
164
+ +publications of the article with ID ` 1 ` ():
165
+
167
166
168
167
``` text
169
- PATCH /articles/1/links/comments
168
+ PATCH /articles/1/links/publications
170
169
Content-Type: application/vnd.api+json; ext=jsonpatch
171
170
Accept: application/vnd.api+json; ext=jsonpatch
172
171
@@ -175,7 +174,7 @@ Accept: application/vnd.api+json; ext=jsonpatch
175
174
"op": "add",
176
175
"path": "/-",
177
176
"value": [
178
- { "type": "comments ", "id": "123" }
177
+ { "type": "magazines ", "id": "123", "publication_type": "reprint " }
179
178
]
180
179
}
181
180
]
@@ -226,8 +225,8 @@ Accept: application/vnd.api+json; ext=jsonpatch
226
225
#### 204 No Content <a href =" #patch-responses-204 " id =" patch-responses-204 " class =" headerlink " ></a >
227
226
228
227
A server ** MUST** return a ` 204 No Content ` status code in response to a
229
- successful Patch operation in which the client's current attributes remain up to
230
- date.
228
+ successful Patch operation in which the client's current resource attributes
229
+ remain up to date.
231
230
232
231
#### 200 OK <a href =" #patch-responses-200 " id =" patch-responses-200 " class =" headerlink " ></a >
233
232
0 commit comments