Skip to content

ObjectSerializer not working for single object  #472

@SahSantoshh

Description

@SahSantoshh

fast_jsonapi version: 1.5
The object serializer is working fine if an array of objects is passed to serializer:

def index
    contents = Content.page params[:page]
    render json: ContentSerializer.new(contents)
end

But it doesn't work for single object

def show
   options = {}
   options[:include] = %i[content_texts image_labels]
   render json: ContentSerializer.new(@content).serializable_hash, status: 200
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions