8000 Allow to modify API basePath via annoations by aleks-fofanov · Pull Request #30 · alt3/cakephp-swagger · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Allow to modify API basePath via annoations #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 10, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ Use the `ui` section to customize the following Swagger-UI options:
- `route`: expose the UI using a custom route, defaults to `/alt3/swagger/`
- `schemes`: array used to specify third field
[used to generate the BASE URL](https://github.com/alt3/cakephp-swagger/issues/6)
(`host` and `basePath` are fetched realtime), defaults to `null`
(`host` is fetched realtime, `basePath` is also fetched realtime if not
[defined via annotations](https://github.com/alt3/cakephp-swagger/issues/29)),
defaults to `null`

> Please note that the UI will auto-load the first document found in the library.

Expand Down
4 changes: 3 additions & 1 deletion src/Lib/SwaggerTools.php
6245
Original file line number Diff line numberDiff line change
Expand Up @@ -47,7 +47,9 @@ public static function getSwaggerDocument($id, $host)

// set object properties required by UI to generate the BASE URL
$swagger->host = $host;
$swagger->basePath = '/' . Configure::read('App.base');
if (empty($swagger->basePath)) {
$swagger->basePath = '/' . Configure::read('App.base');
}
$swagger->schemes = Configure::read('Swagger.ui.schemes');

// write document to filesystem
Expand Down
0