You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's a bug here (unless I'm reading something wrong) and I can't find an open issue that describes this. Please forgive me if this is a duplicate.
Reproduction set-up
Making a compound document using include. It contains an Organization, which has_many :people, and Personbelongs_to :organization (there are many other cases that would reproduce this, I think). I have an organization with ID 1, and some people belonging to that organization. The document would have an array of people in the included key.
The bug
The JSON API spec says:
A compound document MUST NOT include more than one resource object for each type and id pair.
The compound document consists of a document containing both data and included top-level keys. The data is just the Organization with ID 1, which has relationships which has people which has data, which is an array of Person objects with just type (==people) and id.
In the included top-level key, you have the Person entities related to the organization. But also, the Organization appears here. So you have two resource objects in the same compound document with the same type (organization) and ID (1). That's a bug, right?
The text was updated successfully, but these errors were encountered:
There's a bug here (unless I'm reading something wrong) and I can't find an open issue that describes this. Please forgive me if this is a duplicate.
Reproduction set-up
Making a compound document using
include
. It contains anOrganization
, whichhas_many :people
, andPerson
belongs_to :organization
(there are many other cases that would reproduce this, I think). I have an organization with ID 1, and some people belonging to that organization. The document would have an array of people in theincluded
key.The bug
The JSON API spec says:
The
compound document
consists of a document containing bothdata
andincluded
top-level keys. Thedata
is just theOrganization
with ID 1, which hasrelationships
which haspeople
which hasdata
, which is an array ofPerson
objects with justtype
(==people
) andid
.In the
included
top-level key, you have thePerson
entities related to the organization. But also, theOrganization
appears here. So you have two resource objects in the same compound document with the same type (organization
) and ID (1
). That's a bug, right?The text was updated successfully, but these errors were encountered: