Add attribute-axis to CPS query nodes rest API 89/140189/3
authordanielhanrahan <daniel.hanrahan@est.tech>
Thu, 13 Mar 2025 13:33:27 +0000 (13:33 +0000)
committerdanielhanrahan <daniel.hanrahan@est.tech>
Thu, 13 Mar 2025 14:52:11 +0000 (14:52 +0000)
commit6d5849d012c1a2fe2177d332610a1b99bd44fe40
tree86601e1a701a438055604790d3e7015cae5bb835
parent4f002a7da4001e2fc00d1ed37154112d9c13a828
Add attribute-axis to CPS query nodes rest API

Support attribute-axis in query nodes api for both JSON and XML:
  /cps/v2/dataspaces/{dataspace}/anchors/{anchor}/nodes/query

It allows such queries as:
  //books/@title
which returns a JSON response like: [{"title":"Matilda"},{"title":"Dune"}]
and an XML response like: <title>Matilda</title><title>Dune</title>

Issue-ID: CPS-2620
Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech>
Change-Id: Iab51fbe76281740b8dbde373e11864d3509696ef
cps-rest/src/test/groovy/org/onap/cps/rest/controller/QueryRestControllerSpec.groovy
cps-service/src/main/java/org/onap/cps/impl/CpsFacadeImpl.java
cps-service/src/main/java/org/onap/cps/utils/DataMapper.java
cps-service/src/test/groovy/org/onap/cps/impl/CpsFacadeImplSpec.groovy