Skip to content

Commit d4c3aa0

Browse files
author
Vignesh C
committed
fixed auth issue for path params
1 parent bedbdab commit d4c3aa0

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/Generator.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,15 @@ public function generate()
5151
$this->docs['paths'][$this->uri] = [];
5252
}
5353

54-
$this->addAuthParameters($route->middleware());
55-
54+
5655
foreach ($methods as $method) {
5756
$this->method = strtolower($method);
58-
57+
5958
if (in_array($this->method, $this->config['ignoredMethods'])) continue;
60-
59+
6160
$this->generatePath();
61+
62+
$this->addAuthParameters($route->middleware());
6263
}
6364
}
6465

@@ -188,7 +189,7 @@ protected function addAuthParameters($middlewares)
188189
return (strpos($var, 'jwt') > -1);
189190
});
190191
if($hasAuth) {
191-
$this->docs['paths']['security'] = [
192+
$this->docs['paths'][$this->uri][$this->method]['security'] = [
192193
'api_key' => []
193194
];
194195
}

0 commit comments

Comments
 (0)