From b5565bcc570e3e334458ca71924040b0a2c15848 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 | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/library/Swagger/Swagger.php b/library/Swagger/Swagger.php index 6ee07bf8d..5dbedef09 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; } @@ -295,7 +292,7 @@ protected function processParser($parser) } $this->authorizations[$authorization->type] = $authorization; } - + } foreach ($parser->getResources() as $resource) { if (array_key_exists($resource->resourcePath, $this->registry)) {