Skip to content

Commit b9a7edd

Browse files
committed
fix(generate-spec): Add fallback scopes before checking ignores
Signed-off-by: provokateurin <[email protected]>
1 parent a644eac commit b9a7edd

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

generate-spec.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -463,15 +463,6 @@
463463
Logger::panic($routeName, 'Route is marked as ignore but also has other scopes');
464464
}
465465

466-
if (in_array('ignore', $scopes, true)) {
467-
if (count($scopes) === 1) {
468-
Logger::debug($routeName, 'Route ignored because of OpenAPI attribute');
469-
continue;
470-
}
471-
472-
Logger::panic($routeName, 'Route is marked as ignore but also has other scopes');
473-
}
474-
475466
if ($scopes === []) {
476467
if ($controllerScopes !== []) {
477468
$scopes = $controllerScopes;
@@ -484,6 +475,15 @@
484475
}
485476
}
486477

478+
if (in_array('ignore', $scopes, true)) {
479+
if (count($scopes) === 1) {
480+
Logger::debug($routeName, 'Route ignored because of OpenAPI attribute');
481+
continue;
482+
}
483+
484+
Logger::panic($routeName, 'Route is marked as ignore but also has other scopes');
485+
}
486+
487487
$routeTags = Helpers::getOpenAPIAttributeTagsByScope($classMethod, $routeName, $tagName, reset($scopes));
488488

489489
if ($isOCS && !array_key_exists('OCSMeta', $schemas)) {

0 commit comments

Comments
 (0)