question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error pointer always refers to the attributes

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
sliverccommented, Oct 2, 2021

@mehdy go for it that would be great

0reactions
mehdycommented, Oct 2, 2021

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

C++ Pointers and References
A reference variable provides a new name to an existing variable. It is dereferenced implicitly and does not need the dereferencing operator *...
Read more >
Pointers in C++
Due to the ability of a pointer to directly refer to the value that it points to, a pointer has different properties when...
Read more >
introduce `allowzero` pointer attribute which makes 0x0 an ...
allowzero on a C pointer is always a compile error. Use a zig pointer please! For non-freestanding targets, allowzero is a compile error....
Read more >
Pointer declaration - cppreference.com
Certain addition, subtraction, increment, and decrement operators are defined for pointers to elements of arrays: such pointers satisfy the ...
Read more >
Array and Sized-Pointer Attributes - MIDL - Microsoft Learn
The MIDL compiler reports an error if a function result is a reference pointer, either explicitly or by default. The returned pointer always ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found