From a6fdaff7ae03da6c9ddb45eb216c9a6d4ab84254 Mon Sep 17 00:00:00 2001 From: Gunnar Lium Date: Tue, 9 Dec 2014 16:22:09 +0100 Subject: [PATCH] Remove basePath from resource list basePath is not a valid element in the resource list, and it causes swagger-ui to load the wrong paths from the backend, in effect breaking the entire service. See this for a related issue: https://github.com/swagger-api/swagger-ui/issues/490 --- library/Swagger/Swagger.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/library/Swagger/Swagger.php b/library/Swagger/Swagger.php index a844c80c2..1c75bf30d 100755 --- a/library/Swagger/Swagger.php +++ b/library/Swagger/Swagger.php @@ -129,7 +129,7 @@ public function getResourceList($options = array()) } else { $result = array(); } - foreach (array('basePath', 'apiVersion', 'swaggerVersion') as $key) { + foreach (array('apiVersion', 'swaggerVersion') as $key) { if (array_key_exists($key, $result) === false) { $result[$key] = $options[$key]; } @@ -153,9 +153,6 @@ public function getResourceList($options = array()) } $result['apis'][] = $api; } - if ($result['basePath'] === null) { - unset($result['basePath']); - } if ($this->info !== null) { $result['info'] = $this->info; }