As stated in the JSON API specs a resource linkage object may have these values:
Resource linkage MUST be represented as one of the following:
null for empty to-one relationships.
an empty array ([]) for empty to-many relationships.
a single resource identifier object for non-empty to-one relationships.
an array of resource identifier objects for non-empty to-many relationships.
https://jsonapi.org/format/#document-resource-object-linkage
After the json-api-vanilla parsing is return an Object instead.
To reproduce:
it "should handle null data" do
expect(doc.data.first.comments.last.author).to be_nil
end
Result:
expected: nil
got: #<Object:0x0000557bbcd4bd08>
We have noticed the fallback creation of an object here:
Removing that line make all specs green but maybe it will results in other "untested" issues.
As stated in the JSON API specs a resource linkage object may have these values:
After the json-api-vanilla parsing is return an
Objectinstead.To reproduce:
Change the
example.json:84from"data": { "type": "people", "id": "9" }to
"data": nullAdd the following test:
Result:
We have noticed the fallback creation of an object here:
Removing that line make all specs green but maybe it will results in other "untested" issues.