mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
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: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
parent
eb6cf1fad0
commit
e50f352643
1 changed files with 6 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue