diff --git a/src/Api.php b/src/Api.php index 2b44eb5..77b4435 100644 --- a/src/Api.php +++ b/src/Api.php @@ -331,9 +331,19 @@ class Api */ public function get($path, $content = null, $headers = null, $is_authenticated = true) { - return $this->decodeResponse( - $this->rawCall("GET", $path, $content, $is_authenticated, $headers) - ); + if(preg_match('/^\/[^\/]+\.json$/', $path)) + { + // Schema description must be access without authentication + return $this->decodeResponse( + $this->rawCall("GET", $path, $content, false, $headers) + ); + } + else + { + return $this->decodeResponse( + $this->rawCall("GET", $path, $content, $is_authenticated, $headers) + ); + } } /** diff --git a/tests/ApiFunctionalTest.php b/tests/ApiFunctionalTest.php index f8fd6b9..59d3954 100644 --- a/tests/ApiFunctionalTest.php +++ b/tests/ApiFunctionalTest.php @@ -257,6 +257,6 @@ class ApiFunctionalTest extends \PHPUnit_Framework_TestCase public function testApiGetWithoutAuthentication() { $api = new Api(NULL,NULL, $this->endpoint, null, $this->client); - $api->get('/hosting/web/moduleList'); + $api->get('/hosting/web/moduleList',null,null,false); } }