fast_jsonapi
fast_jsonapi copied to clipboard
Record included twice in response when using included records.
This is an interesting case, and I am not 100% sure if this is a bug, but the way fast_jsonapi handles it is different than how AMS handles it. Also ember-data 2.13 seems to have issues with the way fast_jsonapi handles it as well.
Given a relationship like
class Parent
has_many :children
end
class Child
belongs_to :parent
end
When a child is created and the include param is like parent.children the created child is both in the top level data field (as expected), and it is also in the included records.
With AMS it seems that the record in data is not repeated in the included records.
I could not find mention of this in the json api spec.
A fictional example of what this would look like when rendered to json. Notice that the "child" is in both the data, and included.
{
"data": {
"type": "child",
"id": "1",
"attributes": {},
"relationships": {
"parent": {"id": "2", "type": "parent"}
}
},
"included": [
{
"type": "child",
"id": "1",
"attributes": {},
"relationships": {
"parent": {"id": "2", "type": "parent"}
}
},
{
"type": "parent",
"id": "2",
"attributes": {},
"relationships":{
"children": [{"id": "1", "type": "child"}]
}
}
]
}
Are issues being actively dealt with? I have seen a decrease in responsiveness, and commits for this project. I have an open pull request for this issue, and I have received no feedback on it. It would be helpful for the community to know the maintainability of this project going forward.