Skip to content

Commit 8f7174a

Browse files
committed
Add support for multiple swagger base paths
1 parent 11aadab commit 8f7174a

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/Robo/RoboFileAbstract.php

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,17 @@ public function testBehat($opts = ['silent|s' => false])
101101
*/
102102
public function generateApiDoc()
103103
{
104-
foreach ($this->getApplicationBasePaths() as $applicationName => $basePath) {
105-
$jsonPath = $basePath . '/www/swagger.json';
106-
$this->taskExec('vendor/bin/swagger')
107-
->arg($basePath)
108-
->option('--output')
104+
foreach ($this->getApplicationBasePaths() as $applicationName => $basePaths) {
105+
$basePaths = (array)$basePaths;
106+
$basePath = reset($basePaths);
107+
$jsonPath = $basePath . '/www/swagger.json';
108+
$task = $this->taskExec('vendor/bin/swagger');
109+
110+
foreach ($basePaths as $path) {
111+
$task->arg($path);
112+
}
113+
114+
$task->option('--output')
109115
->arg($jsonPath)
110116
->run();
111117

0 commit comments

Comments
 (0)