Affects Version/s: 7.4.X
Component/s: REST infrastructure (vulcan)
While testing MessageBoardMessage APIs, we noticed that the `putMessageBoardMessage` method requires the showAsAnswer field to be included in the request body. (Related Slack Thread)
I was calling the `putMessageBoardMessage` method for MessageBoardMessage using the following request body:
It should replace the specified Message Board Message with the information sent in the request body.
It returned the following message: ` "status": "INTERNAL_SERVER_ERROR"`
This PUT command only works if you include the "showAsAnswer" field in the request body:
I'm using liferay/dxp:7.4.12-ep3-d1.6.5-20210823093930
Steps to Reproduce
1. Start a Docker container
2. Login and go to http://localhost:8080/o/api
3. Under Headless Delivery, go to the MessageBoardThread service, and expand the POST to Site API (i.e., postSiteMessageBoardThread)
4. Enter your Site id (e.g., 20125), remove all request fields except for headline, and execute the request.
5. Copy the new Message Board Thread's ID.
6. Go to MessageBoardMessage service, and expand the POST to Thread API (i.e., postMessageBoardThreadMessageBoardMessage)
7. Enter the new Thread's ID, remove all request fields except for headline, and execute the request.
8. Copy the new Message Board Message's ID.
9. Expand the PUT by Message ID API (i.e., putMessageBoardMessage)
10. Enter the new Message's ID, remove all request fields except for headline, and execute the request.
This will return the "INTERNAL_SERVER_ERROR" message.
11. Add the showAsAnswer field to the request body and execute the request. (It doesn't matter if the field's value is true or false)
This will execute the command as expected, replacing the specified Message's fields.