Skip to content

Commit e7edd54

Browse files
authored
Update collections.md
1 parent 6c2789b commit e7edd54

File tree

1 file changed

+89
-1
lines changed

1 file changed

+89
-1
lines changed

graph/articles/collections.md

Lines changed: 89 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,95 @@ Clients will now be able to refer to individual `bar`s using `prop1` as a key, a
369369
```http
370370
DELETE /foos/{fooId}/bars/{some_prop1}
371371
```
372-
```json
372+
```http
373+
HTTP/1.1 204 No Content
374+
```
375+
The expectation is that `bars` and `barsAsEntities` are treated as two "views" into the same data.
376+
To meet this expectation, workloads must:
377+
1. Keep the properties consistent between `bar` and `barAsEntity`.
378+
Any changes to one type must be reflected in the other type.
379+
2. Reject requests that update both collections at the same time.
380+
A request that adds an item to `barsAsEntities` while replacing the content of `bars` must rejected with a `400`, for example:
381+
```http
382+
PATCH /foos/{fooId}
383+
{
384+
"bars": [
385+
{
386+
"prop1": "some value",
387+
"prop2": "another value"
388+
}
389+
],
390+
"barsAsEntities@delta": [
391+
{
392+
"prop1": "a key value",
393+
"prop2": "some new value"
394+
}
395+
]
396+
}
397+
```
398+
```http
399+
HTTP/1.1 400 Bad Request
400+
{
401+
"error": {
402+
"code": "badRequest",
403+
"message": "'bars' and 'barsAsEntities' cannot be updated in the same request.",
404+
}
373405
```
374406

407+
TODO should this be a 409 conflict instead?
408+
TODO implement this in WebApi
409+
375410
### 11.2 TODO $select trickery
411+
412+
413+
414+
415+
416+
417+
418+
419+
420+
421+
422+
423+
424+
425+
426+
427+
428+
429+
430+
431+
432+
433+
434+
435+
436+
437+
438+
439+
440+
441+
442+
443+
444+
445+
446+
447+
448+
449+
450+
451+
452+
453+
454+
455+
456+
457+
458+
459+
460+
461+
462+
463+

0 commit comments

Comments
 (0)