loopback-component-jsonapi
loopback-component-jsonapi copied to clipboard
[BUGFIX] include may not have a .relation and just be a { [modelName]: true } sometimes
Used to fail when my model has a default scope in its model.json
scope: {
include: ['model1', 'model2']
}
and I make a filter REST API call with
/api/model?include=model3
Turns out the requested include was never included in the serialised result because
isLoopbackIncludechecked for an incomplete condition, which overrodeisJSONAPIInclude-> addedctx.args.filter.includeto make it correctsetRequestedIncludedid not account for object of type{ [modelName]: true }-> made it do so