Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Invalid
-
3.0.0-M1
-
None
-
None
Description
Patching (ADD_REPLACE) an anyObject with a relationships that already exists returns 409
GET /anyObjects/ccsd
{{{}
{ "_class": "org.apache.syncope.common.lib.to.AnyObjectTO", "key": "c8fa2d14-3362-4b18-ba2d-143362db1894", "type": "COLLABORATION", "name": "ccsd", "relationships": [ \{ "type": "RELATION_COLLABORATION_DOMAINE", "otherEndType": "DOMAINE_SCIENTIFIQUE", "otherEndKey": "509678c4-c32b-49e5-9678-c4c32bd9e5e3", "otherEndName": "Pluri-valorisation" }]}{}}}{}
{{PATCH /anyObjects/c8fa2d14-3362-4b18-ba2d-143362db1894 -d '{ "_class": "org.apache.syncope.common.lib.request.AnyObjectUR", "key": "c8fa2d14-3362-4b18-ba2d-143362db1894", "relationships": [ { "operation": "ADD_REPLACE", "relationshipTO":
{ "type": "RELATION_COLLABORATION_DOMAINE", "otherEndType": "DOMAINE_SCIENTIFIQUE", "otherEndKey": "509678c4-c32b-49e5-9678-c4c32bd9e5e3", "otherEndName": "Pluri-valorisation" }} ] } '}}
{{
{ "status": 409, "type": "EntityExists", "elements": [ "A violation of the constraint imposed by a unique index or a unique constraint occurred" ] }}}
I'm not sure if this is a bug or a feature, but I feel like ADD_REPLACE should behave like for plain attributes or resources (return 200 even if same value)