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 authored and bfanger committed Apr 17, 2015
1 parent c251e30 commit a6fdaff
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 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

0 comments on commit a6fdaff

Please sign in to comment.