- cpsQueryService.queryDataNodes(dataspaceName, anchorName, cpsPath);
- return new ResponseEntity<>(new Gson().toJson(dataNodes), HttpStatus.OK);
+ cpsQueryService.queryDataNodes(dataspaceName, anchorName, cpsPath, fetchDescendantsOption);
+ final List<Map<String, Object>> dataNodeList = new ArrayList<>();
+ dataNodes.stream()
+ .forEach(dataNode -> dataNodeList.add(DataMapUtils.toDataMapWithIdentifier(dataNode)));
+ return new ResponseEntity<>(jsonObjectMapper.asJsonString(dataNodeList), HttpStatus.OK);