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 <kevr@0cost.org>
This commit is contained in:
Kevin Morris 2021-08-31 17:13:10 -07:00
parent 565f62471b
commit cfa95ef80a
No known key found for this signature in database
GPG key ID: F7E46DED420788F3

View file

@ -272,6 +272,15 @@ class AurJSON {
'results' => $data '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) { if ($error) {
$json_array['error'] = $error; $json_array['error'] = $error;
} }