X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=cps-rest%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fcps%2Frest%2Fcontroller%2FQueryRestController.java;h=7a96cffff232f79338b8da1ca55634c740605e10;hb=ebfa4077b2e462237301e93566fed6ef2f56674c;hp=eb422dc69e16fa47c582c8a434dd9ea551cd10e7;hpb=a15c0e5b58f16c3ab4a7c7610ac8c4a191e5e051;p=cps.git diff --git a/cps-rest/src/main/java/org/onap/cps/rest/controller/QueryRestController.java b/cps-rest/src/main/java/org/onap/cps/rest/controller/QueryRestController.java index eb422dc69..7a96cffff 100644 --- a/cps-rest/src/main/java/org/onap/cps/rest/controller/QueryRestController.java +++ b/cps-rest/src/main/java/org/onap/cps/rest/controller/QueryRestController.java @@ -1,6 +1,7 @@ /* * ============LICENSE_START======================================================= * Copyright (C) 2021-2022 Nordix Foundation + * Modifications Copyright (C) 2022 Bell Canada. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,9 +54,8 @@ public class QueryRestController implements CpsQueryApi { final Collection dataNodes = cpsQueryService.queryDataNodes(dataspaceName, anchorName, cpsPath, fetchDescendantsOption); final List> dataNodeList = new ArrayList<>(); - for (final DataNode dataNode : dataNodes) { - dataNodeList.add(DataMapUtils.toDataMap(dataNode)); - } + dataNodes.stream() + .forEach(dataNode -> dataNodeList.add(DataMapUtils.toDataMapWithIdentifier(dataNode))); return new ResponseEntity<>(jsonObjectMapper.asJsonString(dataNodeList), HttpStatus.OK); } }