Skip to content

Serializer should be able to specify serializer class.  #112

Open
@yxhuvud

Description

@yxhuvud

Currently, the only way to specify what class to use for when serializing a relationship is to give the renderer the class option with a hash with an entry for each serialized resource.

In fast_jsonapi it is possible to specify that for each relationship in the serializer. Sadly, they have no support for polymorphic relationships and doesn't seem to get support for that anytime soon. That

a: It allows specific different views of the same thing, which allow the database layout to be more decoupled from the jsonapi presentation.

b: For users that doesn't think the default lookup path and naming for serializers are good enough, it allows them to not have to repeat every single serializer every single time they have to serialize something.

c: It allows more than one view of the same type of object in the same serialized response.

So I think it would be extremely nice if it was a feature that was supported.

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