Skip to content

CD: primary resources are repeated in included #211

Closed

Description

@MoonWorm

When an include path cycles back to a primary resource (e.g. /users/1?include=relatives.relatives, or /users?include=relatives where users in data are relatives of each other), that resource appears in both data and included. This breaks the JSON:API rule that a compound document must not contain more than one resource object per type/id pair. The fix replaces the boolean jsonapi4j.cd.deduplicateResources with jsonapi4j.cd.deduplication, which takes one of three values:

  • DATA_AND_INCLUDED (default, spec-compliant);
  • INCLUDED_ONLY, which repeats reached primary resources in included so clients can resolve every relationship from included alone;
  • NONE, no deduplication.

Activity

  1. added a commit that references this issue on Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions