Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to decode gerrit code review rest api responses

I've read this for querying gerrit https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html

But even in the examples in the document the response from gerrit has this garbled string at the start of what looks like a valid array of change detail records, and this means it is not valid json. I'm using the requests module for python to access the /changes end point. Has anyone successfully decoded the "json" output from the gerrit code review server?

like image 324
Edmund Adjei Avatar asked Oct 19 '25 00:10

Edmund Adjei


1 Answers

You need to strip the ")]}" prefix of the Gerrit output.

See more details in Gerrit documentation here.

like image 178
Marcelo Ávila de Oliveira Avatar answered Oct 21 '25 14:10

Marcelo Ávila de Oliveira



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!