From: Marcin Haba Date: Fri, 5 Mar 2021 03:58:15 +0000 (+0100) Subject: baculum: Unify /jobs/{jobid}/files endpoint output for detailed and normal modes X-Git-Tag: Release-11.0.2~45 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=26072e735282e9ae8c0acc59c9872eacb120db83;p=thirdparty%2Fbacula.git baculum: Unify /jobs/{jobid}/files endpoint output for detailed and normal modes --- diff --git a/gui/baculum/protected/API/Pages/API/JobListFiles.php b/gui/baculum/protected/API/Pages/API/JobListFiles.php index 716b80ed0..a01cfe3d5 100644 --- a/gui/baculum/protected/API/Pages/API/JobListFiles.php +++ b/gui/baculum/protected/API/Pages/API/JobListFiles.php @@ -63,11 +63,13 @@ class JobListFiles extends BaculumAPIServer { 'limit' => $limit, 'search' => $search ]); - //NOTE: Standarize raw and json output in new version API v2 - $result = [ - 'items' => $result, - 'totals' => count($result) - ]; + if (APIServer::getVersion() === 1) { + // TODO: Remove it when APIv1 will not be used + $result = [ + 'items' => $result, + 'totals' => count($result) + ]; + } } $this->output = $result; $this->error = GenericError::ERROR_NO_ERRORS; diff --git a/gui/baculum/protected/API/openapi_baculum.json b/gui/baculum/protected/API/openapi_baculum.json index af963dca8..909a293bf 100644 --- a/gui/baculum/protected/API/openapi_baculum.json +++ b/gui/baculum/protected/API/openapi_baculum.json @@ -1031,19 +1031,10 @@ "type": "object", "properties": { "output": { - "type": "object", - "properties": { - "items": { - "type": "array", - "items": { - "type": "string", - "description": "Show job files output list" - } - }, - "total": { - "type": "integer", - "description": "Total number of items" - } + "type": "array", + "items": { + "type": "string", + "description": "Job files output list" } }, "error": {