AnsweredAssumed Answered

Adding an aspect to a comment node has error

Question asked by sepgs2004 on Sep 17, 2018
Latest reply on Sep 27, 2018 by sepgs2004

I used google rest api client. I wonder why this error. It appears that aspects are not allowed for comment nodes.

 

 

Http Request

PUT

alfresco/api/-default-/public/alfresco/versions/1/nodes/19a82881-3d00-4b8a-8276-dc3d8237cda8/comments/c6c9e3af-6e0b-46ad-8e11-648e1a27e7e6

 

JSON Body
{
"aspectNames": [
"slo:operationInfo"
],
"content":"Test threez",
"lo_operation_user":"Goose"
}

 

Response

{
"error": {
"errorKey": "Could not read content from HTTP request body: Unrecognized field \"aspectNames\" (Class org.alfresco.rest.api.model.Comment), not marked as ignorable\n at [Source: java.io.BufferedReader@37b1c0b7; line: 2, column: 19] (through reference chain: org.alfresco.rest.api.model.Comment[\"aspectNames\"])",
"statusCode": 400,
"briefSummary": "08170028 Could not read content from HTTP request body: Unrecognized field \"aspectNames\" (Class org.alfresco.rest.api.model.Comment), not marked as ignorable\n at [Source: java.io.BufferedReader@37b1c0b7; line: 2, column: 19] (through reference chain: org.alfresco.rest.api.model.Comment[\"aspectNames\"])",
"stackTrace": "For security reasons the stack trace is no longer displayed, but the property is kept for previous versions",
"descriptionURL": ""
}
}

 

 

 

 

 

When I read the node details of the comment object
I get the following
GET
alfresco/api/-default-/public/alfresco/versions/1/nodes/c6c9e3af-6e0b-46ad-8e11-648e1a27e7e6

 

Response

{
"entry": {
"aspectNames": ["cm:titled",
"cm:auditable"],
"createdAt": "2018-09-17T18:01:05.056+0000",
"isFolder": false,
"isFile": true,
"createdByUser": {
"id": "admin",
"displayName": "Administrator"
},
"modifiedAt": "2018-09-17T19:48:48.777+0000",
"modifiedByUser": {
"id": "admin",
"displayName": "Administrator"
},
"name": "c6c9e3af-6e0b-46ad-8e11-648e1a27e7e6",
"id": "c6c9e3af-6e0b-46ad-8e11-648e1a27e7e6",
"nodeType": "fm:post",
"content": {
"mimeType": "text/html",
"mimeTypeName": "HTML",
"sizeInBytes": 11,
"encoding": "UTF-8"
},
"parentId": "d1c6b26d-0956-46cb-a6a2-c254b60a2c77"
}
}

Outcomes