Open nickschot opened 7 years ago
I believe this is actually an error in the ember-data implementation, not Lux. See this section of the JSON API spec.
I'm going to close this issue for now.
-- oops, thought it was another issue.
EDIT: improvements to the first post to better clarify what this specific feature request is.
Can be enabled by toggling this boolean: https://github.com/postlight/lux/blob/7bf2478bd0305d65549f9b9fe98997f51dc07ae0/src/packages/serializer/index.js#L728
@nickschot I believe the lines have shifted since your link. Did you mean formatRelationships
?
They seem to have! And I do! Thanks for pointing that out. I modified the comment with a more resilient link.
How / where are you setting this value to true
?
I am not currently. It can be set to true in the lux codebase as pointed out in the comment as an initial fix for this issue, some tests would need to be added though.
When requesting to include records for relationships of the requested record (i.e.
my-model?include=something1,something2
, the relationships of those records are not included in the response.I think this throws off at least ember-data a bit as it won't recognise any relationships for those records.
EDIT: some more information for this added below.
Example request:
GET /my-model/1?include=something
Example response from Lux (with the missing relationships for the records in "included"):