Skip to content

Commit

Permalink
Remove basePath from resource list
Browse files Browse the repository at this point in the history
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: swagger-api/swagger-ui#490
  • Loading branch information
gunnarlium committed Dec 9, 2014
1 parent b7e3138 commit b5565bc
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions library/Swagger/Swagger.php
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
Expand All @@ -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;
}
Expand Down Expand Up @@ -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)) {
Expand Down

0 comments on commit b5565bc

Please sign in to comment.