add all controllers logic
This commit is contained in:
@@ -29,7 +29,7 @@ class OpenApiRouteExporter
|
||||
|
||||
private function mergeRoute(array &$paths, Route $route): void
|
||||
{
|
||||
if (!$this->isApiControllerRoute($route)) {
|
||||
if (!$this->isDocumentableRoute($route)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -70,14 +70,27 @@ class OpenApiRouteExporter
|
||||
}
|
||||
}
|
||||
|
||||
private function isApiControllerRoute(Route $route): bool
|
||||
private function isDocumentableRoute(Route $route): bool
|
||||
{
|
||||
$uri = ltrim($route->uri(), '/');
|
||||
if (!str_starts_with($uri, 'api/v1') && !str_starts_with($uri, 'v1/')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$action = $route->getActionName();
|
||||
if (!is_string($action)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return str_starts_with($action, 'App\\Http\\Controllers\\Api\\');
|
||||
if (str_contains($action, 'DocsController')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($action === 'Closure') {
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private function resolveTag(string $uri): string
|
||||
|
||||
Reference in New Issue
Block a user