Commit bf4b4cd
authored
Fix empty relationships on included resources (#1372)
JSONAPI::ResourceTree#load_included was failing to correctly
populate the resource fragments of included resources, such that
the `include_related` parameter was null. This was resulting in
the relationships object lacking a data attribute for nil or
empty resources.
The JSON-API specification states that a null or empty array should
be returned in these circumstances:
https://jsonapi.org/format/#document-resource-object-linkage
The underlying issue appears to be the use of `include_related` rather
than the symbol `:include_related` when initializing nested resource
fragments.1 parent 695bb7c commit bf4b4cd
File tree
2 files changed
+3
-2
lines changed- lib/jsonapi
- test/controllers
2 files changed
+3
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4371 | 4371 | | |
4372 | 4372 | | |
4373 | 4373 | | |
4374 | | - | |
| 4374 | + | |
| 4375 | + | |
4375 | 4376 | | |
4376 | 4377 | | |
4377 | 4378 | | |
| |||
0 commit comments