| Issue 3415: | Changes REST API /abandon endpoint's message parameter does not behave as expected | |
| 1 person starred this issue and may be notified of changes. | Back to list |
*****************************************************************
***** *****
***** !!!! THIS BUG TRACKER IS FOR GERRIT CODE REVIEW !!!! *****
***** *****
***** DO NOT SUBMIT BUGS FOR CHROME, ANDROID, CYANOGENMOD, *****
***** INTERNAL ISSUES WITH YOUR COMPANY'S GERRIT SETUP, ETC.*****
***** *****
***** THOSE ISSUES BELONG IN DIFFERENT ISSUE TRACKERS *****
***** *****
*****************************************************************
Affected Version: 2.10.0
What steps will reproduce the problem?
1. Call /abandon via REST API with the data {"message": "This is the message"}
2.
3.
What is the expected output? What do you see instead?
Expect the message "This is the message" to be appended to the change message after "Abandoned".
Instead only the word "message" is appended.
Please provide any additional information below.
I've made the REST POST with {"message": "This is the message"} based on the description of AbandonInfo in the documentation [1].
With some experimentation I got the desired result by passing only "This is the message" as the data.
I am not sure if this is the correct behaviour. If it is, I think it should be better documented.
[1] https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#abandon-input
Jun 9, 2015
I found this while writing the script to abandon changes [1] on 2.10.4; I didn't test against master. Now looking at your comment, I guess the problem was that I was passing a python dict into the requests.post call, rather than a string containing a json dict. I'll double check and then if that's the case I'll close this. [1] https://gerrit-review.googlesource.com/#/c/68540/1/contrib/abandon_stale.py
Jun 9, 2015
Confirmed, it was because I was using a python dict rather than a string representing a json dict :(
Status:
Invalid
|
|
| ► Sign in to add a comment |
Hmm, I cannot reproduce this with current master. Which content-type header did you set? There are 2 ways to provide the message: 1. as JSON with header 'Content-Type: application/json': '{"message": "This is the message."}' 2. as plain text with header 'Content-Type: text/plain': 'This is the message.' Both ways work for me. The second case is enabled by the @DefaultInput annotation on the message field in AbandonInput.