-
Type:
Service Pack Request
-
Status: Closed
-
Resolution: Fixed
-
Affects Version/s: 5.2.3, 6.1
-
Fix Version/s: 6.2, 6.0.N, 6.1.N, 5.2.7, ACS 201911-GA
-
Component/s: ACS REST API
-
Labels:
-
Bug Priority:
-
ACT Numbers:
00987056
-
Epic Link:
There is a RestAPI to create a node as
“POST /nodes/{nodeId}/children”
.
We can set properties in the JSON body as shown at (*1) when we create a new node, but it fails to create a node when we set a wrong value to cm:creator like we set a username, which does not exist in the repository. This is expected as cm:creator is one of the cm:auditable aspect as a mandatory property. Although, we get "201 successful response". We should be able to get the failed response.
Steps to reproduce
1. Run the create node POST RestAPI query with the following JSON Body. Note: Please make sure to set the username to cm:creator, which does not exist in the repository.
(*1) Request JSON Body
{ "name":"My Other Folder", "nodeType":"cm:folder", "properties": { "cm:title":"Folder title", "cm:description":"This is an important folder", "cm:creator": "doesnotexist" } }
Here is the example query.
http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/5ee92b00-db16-4f60-b2bb-98047e5d0faf/children
Observed Behaviour
it outputs the 201 successful response with this output, but we cannot see the node uuid-3a8476ee-0f10-4255-9de1-ee1a76449788 in the database nor Alfresco Share under the parent
{ "entry": { "aspectNames": ["cm:titled", "cm:auditable"], "createdAt": "2019-03-13T03:39:02.863+0000", "isFolder": true, "isFile": false, "createdByUser": { "id": "doesnotexist04", "displayName": "doesnotexist04" }, "modifiedAt": "2019-03-13T03:39:02.863+0000", "modifiedByUser": { "id": "admin", "displayName": "Administrator" }, "name": "My Other Folder04", "id": "3a8476ee-0f10-4255-9de1-ee1a76449788", "nodeType": "cm:folder", "properties": { "cm:title": "Folder title04", "cm:description": "This is an important folder" }, "parentId": "5ee92b00-db16-4f60-b2bb-98047e5d0faf" } }
Expected Behaviour
It should outputs the failed response
- shadowed by
-
REPO-4303 Service Pack: MNT-20436 "POST /nodes/{nodeId}/children" RestAPI does not create a node without having a mandatory value object, but it outputs the 201 successful response
- Done