Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Error pointer always refers to the attributes #413

Closed
@jkostrzewski

Description

@jkostrzewski

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

{
    "data": {
        "type": "comment",
        "attributes": {
            "text": "comment text"
        },
        "relationships": {
            "author": {
                "data": {
                    "id": "1 (invalid id)",
                    "type": "author"
                }
            }
        }
    }
}

I got the following response:

{
    "errors": [{
        "status": "400",
        "source": {"pointer": "/data/attributes/author"}, 
        "detail": "Error message"
    }]
}

But would rather expect the following response:

{
    "errors": [{
        "status": "400",
        "source": {"pointer": "/data/relationships/author"}, 
        "detail": "Error message"
    }]
}

So the two responses are different when it comes to source/pointer.
Which version is the proper one? According to the specs the pointer should point to the associated entity in the request document.

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