Issue 2877: Can not set comments to NULL for Review
Status:  Released
Owner:
Closed:  Sep 2014
Reported by Hxq...@gmail.com, Aug 31, 2014


We can see from the link that the "message" field is optional

Documentation/rest-api-changes.html#review-input


but I met 500 error in following case 

1)  "message": null

2) "message": ""

3) remove this field in the json file


can someone help to check why?
 
Aug 31, 2014
Project Member #1 david.pu...@sonymobile.com
Which version of Gerrit?

Please include an example of the REST call that you are sending.  Confidential information can be replaced with dummy values.

Status: AwaitingInformation
Aug 31, 2014
#2 Hxq...@gmail.com
Gerrit 2.8

json file (review2):
{
    "message": "demo",
    "labels": {
      "Code-Review": 2
    },
    "comments": {
      "ffl_tool/FakeEventSender.java": [
        {
          "line": 160,
          "range": {
            "start_line": 150,
            "end_line": 160
          },
        }
      ]
    }
}



curl -v --digest  --user xueqi:123456 -X POST -d@review2 --header "Content-Type: application/json"  "http://localhost:8080/a/changes/demo~master~I8f7bb0cc4848be4dc1e413ddf9d459f49f0bb225/revisions/8307639e0ff3f4ff97d9dfea7180610cdc540512/review

Aug 31, 2014
Project Member #3 david.pu...@sonymobile.com
Seems to work for me with the command:

  curl --header "Content-Type: application/json" -X POST -n --digest -d@test.txt http://localhost:8080/a/changes/I3ab7ec4bf375cf7799fef3ded31990859351a7ba/revisions/e6781cdfeddcf0f7ea171a4a1d612277e5bccf69/review

and test.txt with the content:

{
  "labels": {
    "Code-Review": +1
  }
}

Aug 31, 2014
Project Member #4 david.pu...@sonymobile.com
OK, I see you're referring to the message in the CommentInput, not the ReviewInput.

I will check this.

Aug 31, 2014
Project Member #5 david.pu...@sonymobile.com
Reproduced on stable-2.9; testing a patch now.


Status: Accepted
Owner: david.pu...@sonymobile.com
Aug 31, 2014
Project Member #6 david.pu...@sonymobile.com
https://gerrit-review.googlesource.com/59713
Status: ChangeUnderReview
Sep 5, 2014
Project Member #7 huga...@gmail.com
(No comment was entered for this change.)
Status: Submitted
Labels: FixedIn-2.9.1
Sep 11, 2014
Project Member #8 david.pu...@sonymobile.com
(No comment was entered for this change.)
Status: Released