Skip to content

Library do not resolve relationships on infinite levels. #100

Open
@jopejuca

Description

@jopejuca

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions