CPS Delta API 1: Delta between 2 anchors
- CPS Delta Feature Part 1: To find delta between two anchors
- created new endpoint deltaByDataspaceAndAnchors
- endpoint to take dataspaceName, source anchor, target anchor,
xpath, descendants as input
- added new service CpsDeltaService
- added method to find delta between DataNodes:
getDeltaReport
- added method to find removed data nodes: getRemovedDeltaReports
- added method to get Added DataNodes: getAddedDeltaReports
- added method to get Map of xpath to DataNode: convertToXPathToDataNodesMap
- added a POJO for delta report
- Added new JSON data for delta feature testing
- Added groovy test files CpsDeltaServiceImplSpec and DeltaReportBuilderSpec
- code related to update operation, will be added in
separate commit
Issue-ID: CPS-1824
Signed-off-by: Arpit Singh <as00745003@techmahindra.com>
Change-Id: I313f0f71d04b03878be7643f709d8af1aa6df6ba
diff --git a/cps-rest/docs/openapi/components.yml b/cps-rest/docs/openapi/components.yml
index a3016ce..c1b111b 100644
--- a/cps-rest/docs/openapi/components.yml
+++ b/cps-rest/docs/openapi/components.yml
@@ -137,6 +137,24 @@
name: SciFi
- code: 02
name: kids
+ deltaReportSample:
+ value:
+ - action: "ADD"
+ xpath: "/bookstore/categories/[@code=3]"
+ target-data:
+ code: 3,
+ name: "kidz"
+ - action: "REMOVE"
+ xpath: "/bookstore/categories/[@code=1]"
+ source-data:
+ code: 1,
+ name: "Fiction"
+ - action: "UPDATE"
+ xpath: "/bookstore/categories/[@code=2]"
+ source-data:
+ name: "Funny"
+ target-data:
+ name: "Comic"
parameters:
dataspaceNameInQuery:
@@ -187,6 +205,14 @@
schema:
type: string
example: my-anchor
+ targetAnchorNameInQuery:
+ name: target-anchor-name
+ in: query
+ description: target-anchor-name
+ required: true
+ schema:
+ type: string
+ example: my-anchor
xpathInQuery:
name: xpath
in: query