Skip to content
This repository was archived by the owner on Sep 4, 2025. It is now read-only.
This repository was archived by the owner on Sep 4, 2025. It is now read-only.

Add support for filtering included items #137

Open

Description

@mattcollum

The JSON API spec suggests that an API may support an include parameter when fetching resources that allows the caller to specify which related resources to add to the included array. The current version of this library either marshalls all resources or none, depending on which API is used. The returned structs (OnePayload, ManyPayload) do not expose the underlying Included array of Nodes that contain the included items or any other way to control what is serialized. It would be great if the API can either add support for passing in which Node.Types to add to this array or at least expose it to the returned Payloader interface so callers can filter it themselves.

Activity

  1. ComaVN commented on Apr 30, 2019

    @ComaVN

    +1 on this request. Perhaps it could be as simple as just not including any resource structs that only have a primary field?

    See https://github.com/ComaVN/go-jsonapi-test

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions