Skip to content

Error pointer always refers to the attributes #413

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jkostrzewski opened this issue Feb 20, 2018 · 7 comments · Fixed by #986
Closed

Error pointer always refers to the attributes #413

jkostrzewski opened this issue Feb 20, 2018 · 7 comments · Fixed by #986
Labels
bug good first issue Good for newcomers

Comments

@jkostrzewski
Copy link

jkostrzewski commented Feb 20, 2018

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.

@jkostrzewski jkostrzewski changed the title Error pointer always refers to attributes Error pointer always referrs to attributes Feb 20, 2018
@jkostrzewski jkostrzewski changed the title Error pointer always referrs to attributes Error pointer always refers to attributes Feb 20, 2018
@jkostrzewski jkostrzewski changed the title Error pointer always refers to attributes Error pointer always refers to the attributes Feb 20, 2018
@kujbol
Copy link

kujbol commented May 15, 2018

Hello is there any progress on this issue? It is blocking one of our feature

@sliverc
Copy link
Member

sliverc commented May 16, 2018

Thanks for your bug report. There is currently no-one working on. It would be very welcome if you could work on a PR though.

@platinumazure
Copy link
Contributor

Hi @sliverc, I'm interested in looking at this one.

I see that #815 added tests to the old example.tests module and also used snapshots. What would you recommend for this issue if I want to add tests in the new tests module? Are snapshots compatible with your vision for tests moving forward?

@sliverc
Copy link
Member

sliverc commented Dec 28, 2020

@platinumazure Snapshot testing is certainly something we want to continue in the future. I am not so sure about the testing style in test_errors.py module though as it is quite repetitive and could be simplified with some pytest features.

I need to look into this later on anyway. So for a quick fix of this particular issue feel free to add the test to the old example/tests/test_errors.py module.

@sliverc sliverc added good first issue Good for newcomers and removed help wanted labels Sep 29, 2021
@sliverc
Copy link
Member

sliverc commented Sep 29, 2021

For someone who wants to take this up best start looking at the code here.

@mehdy
Copy link
Contributor

mehdy commented Oct 2, 2021

@sliverc Hi, would you mind if I work on this issue?

@sliverc
Copy link
Member

sliverc commented Oct 2, 2021

@mehdy go for it that would be great

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants