@@ -58,8 +58,10 @@ Accept: application/vnd.api+json; ext=jsonpatch
58
58
"path": "/-",
59
59
"value": {
60
60
"type": "photos",
61
- "title": "Ember Hamster",
62
- "src": "http://example.com/images/productivity.png"
61
+ "attributes": {
62
+ "title": "Ember Hamster",
63
+ "src": "http://example.com/images/productivity.png"
64
+ }
63
65
}
64
66
}
65
67
]
@@ -130,7 +132,7 @@ A server **MUST** respond to Patch operations that target a *to-many
130
132
relationship URL* as described below.
131
133
132
134
For all operations, the ` "value" ` ** MUST** contain an object that contains
133
- an array of linkage objects or an empty array, to remove all elements
135
+ an array of linkage objects or an empty array, to remove all elements
134
136
of the relationship.
135
137
136
138
If a client requests a ` "replace" ` operation to a * to-many relationship URL* , the
@@ -147,12 +149,12 @@ Content-Type: application/vnd.api+json; ext=jsonpatch
147
149
Accept: application/vnd.api+json; ext=jsonpatch
148
150
149
151
[
150
- {
151
- "op": "replace",
152
- "path": "",
152
+ {
153
+ "op": "replace",
154
+ "path": "",
153
155
"value": [
154
- { "type": "tags", "id": "2" },
155
- { "type": "tags", "id": "3" }
156
+ { "type": "tags", "id": "2" },
157
+ { "type": "tags", "id": "3" }
156
158
]
157
159
}
158
160
]
@@ -171,9 +173,9 @@ Content-Type: application/vnd.api+json; ext=jsonpatch
171
173
Accept: application/vnd.api+json; ext=jsonpatch
172
174
173
175
[
174
- {
175
- "op": "add",
176
- "path": "/-",
176
+ {
177
+ "op": "add",
178
+ "path": "/-",
177
179
"value": [
178
180
{ "type": "comments", "id": "123" }
179
181
]
@@ -193,9 +195,9 @@ Content-Type: application/vnd.api+json; ext=jsonpatch
193
195
Accept: application/vnd.api+json; ext=jsonpatch
194
196
195
197
[
196
- {
197
- "op": "remove",
198
- "path": "",
198
+ {
199
+ "op": "remove",
200
+ "path": "",
199
201
"value": [
200
202
{ "type": "comments", "id": "5" },
201
203
{ "type": "comments", "id": "13" }
@@ -255,17 +257,21 @@ Accept: application/vnd.api+json; ext=jsonpatch
255
257
"path": "/-",
256
258
"value": {
257
259
"type": "photos",
258
- "title": "Ember Hamster",
259
- "src": "http://example.com/images/productivity.png"
260
+ "attributes": {
261
+ "title": "Ember Hamster",
262
+ "src": "http://example.com/images/productivity.png"
263
+ }
260
264
}
261
265
},
262
266
{
263
267
"op": "add",
264
268
"path": "/-",
265
269
"value": {
266
270
"type": "photos",
267
- "title": "Mustaches on a Stick",
268
- "src": "http://example.com/images/mustaches.png"
271
+ "attributes": {
272
+ "title": "Mustaches on a Stick",
273
+ "src": "http://example.com/images/mustaches.png"
274
+ }
269
275
}
270
276
}
271
277
]
@@ -283,15 +289,19 @@ Content-Type: application/vnd.api+json; ext=jsonpatch
283
289
"data": [{
284
290
"type": "photos",
285
291
"id": "123",
286
- "title": "Ember Hamster",
287
- "src": "http://example.com/images/productivity.png"
292
+ "attributes": {
293
+ "title": "Ember Hamster",
294
+ "src": "http://example.com/images/productivity.png"
295
+ }
288
296
}]
289
297
}, {
290
298
"data": [{
291
299
"type": "photos",
292
300
"id": "124",
293
- "title": "Mustaches on a Stick",
294
- "src": "http://example.com/images/mustaches.png"
301
+ "attributes": {
302
+ "title": "Mustaches on a Stick",
303
+ "src": "http://example.com/images/mustaches.png"
304
+ }
295
305
}]
296
306
}
297
307
]
0 commit comments