Background : we want to include limit/depth/pagination in CPS-Core query APIs where output size is large. it will allow user to limit query outputs.
It was discussed on 11th Nov 2022 in weekly meeting to use 'depth' parameter to limit large outputs.
Implementation :
'depth' query parameter added in below URLs | Notes | Decision |
---|---|---|
URL: http://<IP:PORT>/v1/dataspaces/{dataspace-name}/anchors/{anchor-name}/node?xpath=/&include-descendants=true&depth=1 |
| |
URL: http://<IP:PORT>/v1/dataspaces/{dataspace-name}/anchors/{anchor-name}/nodes/query?cps-path=/&include-descendents=true&depth=1 | ||
Implementations:
changes files | changes/notes | Decision |
---|---|---|
cpsData.yml | nodeByDataspaceAndAnchor: - $ref: 'components.yml#/components/parameters/depthInQuery' | |
cpsQuery.yml | nodesByDataspaceAndAnchorAndCpsPath: | |
components.yml | depthInQuery: | |
FetchDescendantsOption.java | We Need to change this class to accept for any other depth values except -1, 0 and 1. | |
CpsDataPersistenceServiceImpl.java | change in "queryDataNodes" method |