diff --git a/lib/REST/NextCloudNews/Versions.php b/lib/REST/NextCloudNews/Versions.php index 992d66af..24794161 100644 --- a/lib/REST/NextCloudNews/Versions.php +++ b/lib/REST/NextCloudNews/Versions.php @@ -17,7 +17,12 @@ class Versions implements \JKingWeb\NewsSync\REST\Handler { return new Response(405); } if(preg_match("<^/?$>",$path)) { - return new Response(200, ['v1-2']); + $out = [ + 'apiLevels' => [ + 'v1-2' + ] + ]; + return new Response(200, $out); } else { return new Response(404); } diff --git a/tests/REST/NextCloudNews/TestNCNVersionDiscovery.php b/tests/REST/NextCloudNews/TestNCNVersionDiscovery.php index 68dc0574..d58f5b9e 100644 --- a/tests/REST/NextCloudNews/TestNCNVersionDiscovery.php +++ b/tests/REST/NextCloudNews/TestNCNVersionDiscovery.php @@ -14,7 +14,7 @@ class TestNCNVersionDiscovery extends \PHPUnit\Framework\TestCase { } function testVersionList() { - $exp = new Response(200, ['v1-2']); + $exp = new Response(200, ['apiLevels' => ['v1-2']]); $req = new Request("GET", "/"); $h = new Rest\NextCloudNews\Versions($this->data); $res = $h->dispatch($req);