Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Currently after multiple data trees are stored in CPS DB. On performing the GET operation on the same data, with xpath set as root "/", the first data tree is returned by the Get Data Node API. This data tree is returned in form of a JSON Object as follows:

  • CURL Request:
Code Block
curl --location 'http://localhost:8080/cps/api/v1/dataspaces/testDataspace/anchors/sample/node?xpath=%2F' \
--header 'Accept: application/json' \
--header 'Authorization: Basic Y3BzdXNlcjpjcHNyMGNrcyE='
  • Response:
Code Block
titleCurrent JSON response body
collapsetrue
{
        "multiple-data-tree:first-container": {
            "a-leaf": "a-Value"
        }
}
  • CURL Request:
Code Block
curl --location 'http://localhost:8080/cps/api/v1/dataspaces/testDataspace/anchors/multipleDataTree/node?xpath=%2Ffirst-container' \
--header 'Accept: application/json' \
--header 'Authorization: Basic Y3BzdXNlcjpjcHNyMGNrcyE='
  • Response:
Code Block
titleCurrent JSON response body
collapsetrue
{
        "multiple-data-tree:first-container": {
            "a-leaf": "a-Value"
        }
}
  • CURL Request:
Code Block
curl --location 'http://localhost:8080/cps/api/v1/dataspaces/testDataspace/anchors/sample/node?xpath=%2Flast-container' \
--header 'Accept: application/json' \
--header 'Authorization: Basic Y3BzdXNlcjpjcHNyMGNrcyE='
  • Response:
Code Block
titleCurrent JSON response body
collapsetrue
{
    "multiple-data-tree:last-container": {
        "x-leaf": "x-value"
    }
}

Expected Outcome

After the GET API is updated, we want all the data trees to be returned when the xpath is set to root "/" and when a specific xpath is provided we want the functionality to remain as is.

...