From cfa95ef80ad758f1804896f582c73a8f907d9686 Mon Sep 17 00:00:00 2001 From: Kevin Morris Date: Tue, 31 Aug 2021 17:13:10 -0700 Subject: [PATCH] RPC: add deprecation warning for v1-v4 usage With FastAPI starting to come closer to a close, we've got to advertise this deprecation so that users have some time to adjust before making the changes. We have not specified a specific time here, but we'd like this message to reach users of the RPC API for at least a month before any modifications are made to the interface. Signed-off-by: Kevin Morris --- web/lib/aurjson.class.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/web/lib/aurjson.class.php b/web/lib/aurjson.class.php index 86eae22b..e7bc7f97 100644 --- a/web/lib/aurjson.class.php +++ b/web/lib/aurjson.class.php @@ -272,6 +272,15 @@ class AurJSON { 'results' => $data ); + if ($this->version != 5) { + $json_array['warning'] = 'The use of versions lower than 5 is ' + . 'now deprecated and will soon be unsupported. To ensure ' + . 'your API client supports the change without issue, it ' + . 'should use version 5 and adjust for any changes in the ' + . 'API interface. See https://aur.archlinux.org/rpc for ' + . 'documentation related to v5.'; + } + if ($error) { $json_array['error'] = $error; }