Commit e50f3526 authored by Lukas Fleischer's avatar Lukas Fleischer
Browse files

Add a version tag to RPC replies



This is needed for clients to quickly differentiate between different
versions of the RPC API. The version number should be bumped whenever
there is a change that breaks backwards compatibility.

Signed-off-by: default avatarLukas Fleischer <archlinux@cryptocrack.de>
parent eb6cf1fa
......@@ -115,7 +115,12 @@ class AurJSON {
* @return mixed A json formatted result response.
**/
private function json_results($type, $count, $data) {
return json_encode( array('type' => $type, 'resultcount' => $count, 'results' => $data) );
return json_encode(array(
'version' => 2,
'type' => $type,
'resultcount' => $count,
'results' => $data
));
}
private function get_extended_fields($pkgid) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment