Skip to content

Customizing relationships #54

@pattisdr

Description

@pattisdr

Problem

extract_relationships should be able to handle specialized cases, like allowing a links or meta object instead of a data object. For example, in our application it needs to:

  1. recognize other field types as relationships
  2. return a links object instead of a data object with type/id

The relationship data is read-only.

Desired

screen shot 2015-08-04 at 3 28 42 pm

Potential solutions

@jerel suggested a serializer hook like add_relationships for customization.

According to the spec, under relationships you must include a links, data, or meta object. http://jsonapi.org/format/#document-resource-object-relationships. The current extract_relationships just allows for a data object. It would be valuable for users to be able to have a links object, instead.

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