...
Proposed Solution for Scenario 1:
The proposed solution is to drop the support for using parent node xpath in the request and instead the exact xpath of the data node being updated should be provided in the request.
throw an exception when the parent node is provided in the payload
Apart from this based on the RESTful rules, an additional check should be put in place to first fetch the existing data from the database and verify that it exists and is valid before performing the PATCH operation.
Scenario 2: API does not update child nodes
...
Proposed Solution for Scenario 2
...
Solution 2: Add support to update multiple data nodesSolution 1: Limit the update operation to one Data Node at a time
Solution 2: Add support to update multiple data nodes
...
The expected behavior should be as follows:
Scenario 1
throw an exception when the parent node is provided in the payload
modify the API so that it accepts the xpath of data node being updated and handles the payload present under the data node to be updated.
add support for multiple data nodes
Scenario 2
throw an exception if more than one data nodes are present in the payloadadd
Solution 2: Add support to update multiple data nodes
Proposed/Accepted Solution
...