Skip to content

Issue with relationships in POST/PATCH/PUT requests #122

Closed
@martinmaillard

Description

@martinmaillard

If I do a POST request with data containing a relationship:

{
    "data": {
        "type": "comments",
        "attributes": {
            "body": "Hi"
        },
        "relationships": {
            "entry": {
                "data": {
                    "id": "12",
                    "type": "entries"
                }
            }
        }
    }
}

I get the following error:

{
    "errors": [{
        "status": "400",
        "source": {"pointer": "/data/attributes/entry"}, 
        "detail": "Incorrect type. Expected pk value, received OrderedDict."
    }]
}

I understand why this is happening, but I think this is a mistake.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions