From 997505327f242ec5461d02a49221e34ab35b0a18 Mon Sep 17 00:00:00 2001 From: hufeng903 Date: Fri, 7 Apr 2017 14:24:54 +0800 Subject: [PATCH] support scan different directory confing/swaggervel.php app-dir only support one directory. some projects have swagger annotation in different directory . --- src/Jlapp/Swaggervel/routes.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Jlapp/Swaggervel/routes.php b/src/Jlapp/Swaggervel/routes.php index 183799c..5359dbf 100644 --- a/src/Jlapp/Swaggervel/routes.php +++ b/src/Jlapp/Swaggervel/routes.php @@ -18,7 +18,13 @@ Route::get(Config::get('swaggervel.api-docs-route'), function() { if (Config::get('swaggervel.generateAlways')) { - $appDir = base_path()."/".Config::get('swaggervel.app-dir'); + if (is_array(Config::get('swaggervel.app-dir'))) { + foreach (Config::get('swaggervel.app-dir') as $item) { + $appDir[] = base_path() . "/" .$item; + } + } else { + $appDir = base_path() . "/" . Config::get('swaggervel.app-dir'); + } $docDir = Config::get('swaggervel.doc-dir'); if (!File::exists($docDir) || is_writable($docDir)) {