Skip to content

Commit

Permalink
fix(generate-spec): Add fallback scopes before checking ignores
Browse files Browse the repository at this point in the history
Signed-off-by: provokateurin <[email protected]>
  • Loading branch information
provokateurin committed Dec 17, 2024
1 parent a644eac commit b9a7edd
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions generate-spec.php
Original file line number Diff line number Diff line change
Expand Up @@ -463,15 +463,6 @@
Logger::panic($routeName, 'Route is marked as ignore but also has other scopes');
}

if (in_array('ignore', $scopes, true)) {
if (count($scopes) === 1) {
Logger::debug($routeName, 'Route ignored because of OpenAPI attribute');
continue;
}

Logger::panic($routeName, 'Route is marked as ignore but also has other scopes');
}

if ($scopes === []) {
if ($controllerScopes !== []) {
$scopes = $controllerScopes;
Expand All @@ -484,6 +475,15 @@
}
}

if (in_array('ignore', $scopes, true)) {
if (count($scopes) === 1) {
Logger::debug($routeName, 'Route ignored because of OpenAPI attribute');
continue;
}

Logger::panic($routeName, 'Route is marked as ignore but also has other scopes');
}

$routeTags = Helpers::getOpenAPIAttributeTagsByScope($classMethod, $routeName, $tagName, reset($scopes));

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

0 comments on commit b9a7edd

Please sign in to comment.