Skip to content

Deserializing included relationships will not check for registered type #81

@igneel64

Description

@igneel64

Bug report

What is the current behavior?
Deserializing an object where one of the relationships is not registered, throws an error which could be more clear.

TypeError: Cannot read property 'default' of undefined
    at JSONAPISerializer.deserializeResource (JSONAPISerializer.js:413)
    at JSONAPISerializer.deserializeIncluded (JSONAPISerializer.js:484)
    at JSONAPISerializer.js:453
    at Array.forEach (<anonymous>)
    at JSONAPISerializer.deserializeResource (JSONAPISerializer.js:428)
    at JSONAPISerializer.deserialize (JSONAPISerializer.js:266)

https://codesandbox.io/s/goofy-hypatia-jirok

What is the expected behavior?
The expected behaviour based on the code is to throw No type registered for ${type}

Package Version: 2.0.2

@danivek I have found the issue and will submit a PR for that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions