Skip to content

Unmarshaling does not correctly parse the "included" part #346

@fakegermano

Description

@fakegermano

when unmarshaling data that was marshaled with the "included" portion (using GetReferencedStructs interface) the jsonapi unmarshaling does not add the included.

I'd suggest some interface like SetToOneReferencedStructs(name string, referenced interface{}) and SetToManyReferencedStructs(name string, referenced []interface{}) as we do with the IDs to allow the user to decide for themselves if they want or not to unmarshal included structs.

Another option is to add more struct tags to identify the relations (like https://github.com/google/jsonapi does) and do at least a part of the unmarshaling automatically

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions