angular2-jsonapi
angular2-jsonapi copied to clipboard
Library do not resolve relationships on infinite levels.
There is a hard coded limit of 2 in the file json-api.model.js in the functions:
JsonApiModel.prototype.getHasManyRelationship and JsonApiModel.prototype.getBelongsToRelationship
in the line:
if (level <= 1) {
I would suggest either change the documentation, that says:
"The library will try to resolve relationships on infinite levels connecting nested objects by reference. So that you can have a Post, with a list of Comments, that have a User that has Posts, that have Comments... etc."
Or implement a cycle detecting algorithm.
Actually it works parsing infinite levels, connecting objects by reference as described. The limit of 1 is because otherwise it will enter in an infinite loop entering in all the reference. Check this commit: bd02e3a6c91831da0e4f484907c8077cf70888dd
Is this still an issue?