Sitelet https://github.com/jsonapi-serializer/jsonapi-serializer/issues/129
Skip to content

Lazy Load Data does not respect inclusion of nested associations #129

Description

@nattfodd

When I ask for /parents?include=children.line_items I get children in response in the included array, but I don't get children in the data.relationshipds - it's still empty array without IDs.

Steps to Reproduce the Problem

class ChildSerializer < Api::V2::BaseSerializer
  include FastJsonapi::ObjectSerializer

  has_many :line_items, serializer: ChildLineItemSerializer
end

class ChildLineItemSerializer
  include FastJsonapi::ObjectSerializer
end

class ParentLineItemSeriazlier
  include FastJsonapi::ObjectSerializer
end

class ParentSerializer < Api::V2::BaseSerializer
  include FastJsonapi::ObjectSerializer

  has_many :children, serializer: ChildSerializer, lazy_load_data: true
  has_many :line_items, serializer: ParentLineItemSeriazlier
end

Activity

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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions