I've spent the evening playing with the REST API, but I keep getting back a less than helpful "Invalid application/json in request" error with a http status code of 400.
From the docs:
"""
“400 Bad Request” is also returned if required input fields are not set or if options are set which cannot be used together.
"""
I understand that my request is flawed in its formulation, but is there any way to get it to tell me what validation my request failed specifically? It doesn't look like there are any flags, config options, or query parameters related to expanding the error output. I looked in both the response body and the Gerrit logs. Does anyone have any theories beyond that?
Often the response body contains an error string that gives a hint about what is wrong.
Beyond that there is no switch to get more output.
What's the request that you are sending?
I've managed to narrow it down to something I'm doing when I pass it in as "robot_comments". When I pass
```
{"message":"Robot comments","tag":"robot","comments":{"demo.file":[{"id":"41976821557229542092103641930910809939.0","line":2,"updated":"2018-07
-31 05:20:06.394464977","message":"Example comment to demonstrate"}]},"drafts":"PUBLISH_ALL_REVISIONS","notify":"NONE","omit_duplicate_comments":true}
```
The comment is left successfully on the code.
However when I pass the same in the `robot_comments` (and the required fields filled) like this:
```
{"message":"Robot comments","tag":"robot","robot_comments":{"demo.file":[{"id":"41976821557229542092103641930910809939.0","line":3,"updated":"2018-07-31 05:20:42.915378055","message":"Example comment to demonstrate","robot_id":"Manual","robot_run_id":"41976821557229542092103641930910809939","url":"","properties":null,"fix_suggestions":{"fix_id":"","description":"","replacements":{"path":"","range":{"start_line":0,"start_character":0,"end_line":0,"end_character":0},"replacement":""}}}]},"drafts":"PUBLISH_ALL_REVISIONS","notify":"NONE","omit_duplicate_comments":true}
```
The complete response from the server is:
"Invalid application/json in request"
Any thoughts on that?