Skip to content

Single resource causes 'Cannot read property lookup of undefined' #9

@sedouard

Description

@sedouard

Hey there!

This is great stuff, I was looking for an adapter that implemented rc3 so I picked up your branch.

It looks like I'm hitting an error where if my server responds with a resource:

{
        "data": {
            "id": "553ac59965094b476a817fa6",
            "type": "drivers",
            "name": "Wilcox, Fitzgerald"
        }
}

By the time we get to json-serializer, the container field on this is missing. The parsing seems to work correctly and the normalize function in json-api-serializer returns to the super class the json object:

"{"id":"553ac59965094b476a817fa6","name":"Wilcox, Fitzgerald"}"

With a type of driver. However for some reason the container field on the serializer is undefined and applyTransforms on the serializer crashes. Any idea why this is the case? According to rc3 spec this should be fine.

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