jsonapi-serializers icon indicating copy to clipboard operation
jsonapi-serializers copied to clipboard

Duplicate resource in response document.

Open beauby opened this issue 9 years ago • 1 comments

I was writing a benchmark to compare AMS, jsonapi-rb and jsonapi-serializers, and came across the following bug:

When a primary resource can be reached as an included related resource, it will appear both in the primary and included sections of the response document, although the spec states that

A compound document MUST NOT include more than one resource object for each type and id pair.

beauby avatar Dec 12 '16 01:12 beauby

Thanks for the report. This makes sense, we de-dupe everything in the included section, but not between included and primary (so if there is a circular reference back to the primary, it would be also in included).

fotinakis avatar Dec 12 '16 18:12 fotinakis