loopback-component-jsonapi
loopback-component-jsonapi copied to clipboard
Feature/multi level includes
This PR allows to have nested includes.
Exemple:
GET /posts/1?filter[include][comments]=author
will retrieve all comments, as well as the author of each comments
I also removed the unecessary "requestedIncludes" option.
This option should not handle the way this adapter serialize the resources, if there is embedded resources, even if they do not appear in this option, recommended behavior is to have them in the include property as well.
Security consideration: nested includes were previously not handled, it is now the case, like in the loopback documentation, users need to ensure it is secured their side, like they do when using loopback without JSONApi.
Coverage increased (+0.4%) to 94.911% when pulling dc36ee0fe6723499376d9ec38ebc0ae1061d5c06 on Tronix117:feature/multi-level-includes into 40f928273fe50acfebb11cbaf2e0469f0d56efea on digitalsadhu:master.
@digitalsadhu some feedback ?
if you make a call with relationship like:
GET /company-users/{id}/user
and that the ressource linked don't existe we have a error. Should be catch it.
TypeError: Cannot read property 'relationships' of null\n at /loopback-component-jsonapi/lib/serializer.js:373:18
@Tronix117 I'm afraid I don't have time to get my head back into this project. I'm thinking also with the new version of Loopback being a very major breaking change this project might naturally reach an end of life before too long as I won't be attempting to port anything. I'm happy for you to merge PRs as you see fit and continue maintenance if you have the time.
That’s what I though, from our side we are using it on a big production project and forme time to time we have some evolutions to push. I will do what you say, is npm publishing also fully automatic ?