-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support inclusions of complex object graphs #364
Comments
remmeier
added a commit
that referenced
this issue
Mar 12, 2017
- introduced lookup behavior in KatharsisPropreties - switched abort criteria in IncludeLookupSetter from "attribute processed" to "attribute for given resource processed". Same attribute can this way be populated for different resources at different positions in object graph.
remmeier
added a commit
that referenced
this issue
Mar 14, 2017
- introduced lookup behavior in KatharsisPropreties to switch between including only paths from the requested (root) type to support arbitrary inclusions with the include[type] syntax. The former adhering to the JSON API spec, the later providing a powerful extension and used in Katharsis already for quite a while (and for this reason staying the default). - switched abort criteria in IncludeLookupSetter from "attribute processed" to "attribute for given resource processed". The same attribute can this way be populated for different resources at different positions in object graph. With this complex object graphs will get properly supported.
remmeier
added a commit
that referenced
this issue
Mar 14, 2017
- introduced lookup behavior in KatharsisPropreties to switch between including only paths from the requested (root) type to support arbitrary inclusions with the include[type] syntax. The former adhering to the JSON API spec, the later providing a powerful extension and used in Katharsis already for quite a while (and for this reason staying the default). - switched abort criteria in IncludeLookupSetter from "attribute processed" to "attribute for given resource processed". The same attribute can this way be populated for different resources at different positions in object graph. With this complex object graphs will get properly supported.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
complex object graphs, e.g. with parents and children and other cyclic structures, are currently not properly supported. An attribute can only be included once, regardless of its position in the object graph. For example, include=parent.parent.children is currently cut off after the first parent. This limiation should be removed.
Note that:
any implementation must make sure that the IncludeLookupSetter does not get trapped in a cycle. So instead of allowing to follow every attribute only once, it must enforce to follow every attribute per resource only once. As a consequence, IncludeLookupSetter must keep track of what he has already done.
Further note that:
we currently have two inclusion mechanisms:
GET /tasks/?include[projects]=task&include[tasks]=comments
GET /tasks/?include[projects]=task.comments
for cyclic structures they do have different semantics, the former becoming recursive. A feature flag should to be introduced to disable the former and let the application decide whether to use it or not. By default it is enabled to maintain the current behavior.
The text was updated successfully, but these errors were encountered: