...
'depth' query parameter added in below URLs | Notes | Decision |
---|---|---|
URL: http://<IP:PORT>/v1v2/dataspaces/{dataspace-name}/anchors/{anchor-name}/node?xpath=/&include-descendants=true&depth=1 | descendants is optional query parameter with default value of "all". possible values of descendants is as below :
|
|
URL: http://<IP:PORT>/v1/dataspaces/{dataspace-name}/anchors/{anchor-name}/nodes/query?cps-path=/&include-descendents=true&depth=1descendants={all | none | number} | descendants is optional query parameter with default value of "all". possible values of descendants is as below :
|
|
Implementations:
changes files | changes/notes | Decision | |||||||
---|---|---|---|---|---|---|---|---|---|
cpsData.yml | nodeByDataspaceAndAnchor: - $ref: 'components.yml#/components/parameters/depthInQuerydescendantsInQuery' | ||||||||
cpsQuery.yml | nodesByDataspaceAndAnchorAndCpsPath: | ||||||||
components.yml | depthInQuerydescendantsInQuery: | ||||||||
DataRestController.java | @Override | FetchDescendantsOption.java | We Need to change this class to accept for any other depth values except -1, 0 and 1. Do we need to change FetchDescendantsOption to support multiple depths or add depth as separate argument along with FetchDescendantsOption | FragmentRepository.java | @Query(value = "SELECT id, anchor_id AS anchorId, xpath, parent_id AS parentId," | we need to change query to support depth or we can query all fragments and then select fragment data till given depth value(in below code). | FragmentEntityArranger.java | private static FragmentEntity reuniteChildrenWithTheirParents(final Map<Long,we can reunite children as per given depth value. |