loopback-component-jsonapi icon indicating copy to clipboard operation
loopback-component-jsonapi copied to clipboard

using include with related urls fails

Open digitalsadhu opened this issue 10 years ago • 2 comments

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.

digitalsadhu avatar Dec 29 '15 21:12 digitalsadhu

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.~~

tsteuwer avatar Dec 31 '15 17:12 tsteuwer

Worth verifying if this is still an issue. Recent changes might have fixed.

Todo:

  • [ ] add test

digitalsadhu avatar Jan 17 '16 18:01 digitalsadhu