loopback-component-jsonapi
loopback-component-jsonapi copied to clipboard
using include with related urls fails
Example of failing urls: GET http://localhost:3000/api/posts/9/author?include=posts
{
"errors": [
{
"status": 500,
"source": "",
"title": "TypeError",
"code": "",
"detail": "Cannot read property 'keyFrom' of undefined"
}
]
}
Whats happening is that everything hinges off the base model, in this case post so loopback thinks you are asking for posts related to posts which is wrong. We want posts related to the posts authors.
Ignore this:
~~This is actually a case with /plural/:id/singular eg http://127.0.0.1:3000/api/people/70/address, not just with the includes param.~~
~~@digitalsadhu it is failing in the emberloop repository.~~
Worth verifying if this is still an issue. Recent changes might have fixed.
Todo:
- [ ] add test