Details
-
Bug
-
Status: Closed
-
Medium
-
Resolution: Done
-
Istanbul Release
-
None
Description
List Node PATCH Endpoint is expected to replace all the list Node elements, but it fails if existing and new list node element has the same XPath.
Steps to reproduce:
1. Create a bookstore object using PUT nodes API
endpoint: /cps/api/v1/dataspaces/{dataspace-name}/anchors/{anchor-name}/nodes?xpath=/ body: { "test:bookstore": { "bookstore-name": "Chapters1", "categories": [ { "code": "01", "name": "SciFi" } ] } }
2. Update the categories using PATCH list nodes API
endpoint: /cps/api/v1/dataspaces/{dataspace-name}/anchors/{anchor-name}/list-node?xpath=/bookstore body: { "categories": [ { "code": "01", "name": "SciFi-new" }, { "name": "kids2", "code": "02" } ] }
Expected Response-> The list node should get updated without error
Actual Response -> Received below error
{ "status": "500 INTERNAL_SERVER_ERROR", "message": "could not execute statement; SQL [n/a]; constraint [fragment_dataspace_id_anchor_id_xpath_key]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement", "details": "Check logs for details." }
Root cause:
The suspected root cause is explained here CPS-501
Attachments
Issue Links
- mentioned in
-
Page Loading...