File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -12,15 +12,16 @@ remove, only add_ strategy.
12
12
### Why not use the HAL specification?
13
13
14
14
There are several reasons:
15
+
15
16
* HAL embeds child documents recursively, while JSON API flattens the entire
16
17
graph of objects at the top level. This means that if the same "people" are
17
18
referenced from different kinds of objects (say, the author of both posts and
18
19
comments), this format ensures that there is only a single representation of
19
- each person document in the payload.
20
+ each person document in the payload.
20
21
* Similarly, JSON API uses IDs for linkage, which makes it possible to cache
21
- documents from compound responses and then limit subsequent requests to only
22
- the documents that aren't already present locally. If you're lucky, this can
23
- even completely eliminate HTTP requests.
22
+ documents from compound responses and then limit subsequent requests to only
23
+ the documents that aren't already present locally. If you're lucky, this can
24
+ even completely eliminate HTTP requests.
24
25
* HAL is a serialization format, but says nothing about how to update
25
26
documents. JSON API thinks through how to update existing records (leaning on
26
27
PATCH and JSON Patch), and how those updates interact with compound documents
You can’t perform that action at this time.
0 commit comments