mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-03-12 02:26:09 +03:00
Better log message for unsupported http method
This commit is contained in:
parent
22c6eb5958
commit
de8704f643
@ -209,10 +209,10 @@ final class SwaggerPhpDescriber implements ModelRegistryAwareInterface
|
|||||||
$path = $this->normalizePath($route->getPath());
|
$path = $this->normalizePath($route->getPath());
|
||||||
$httpMethods = $route->getMethods() ?: Swagger::$METHODS;
|
$httpMethods = $route->getMethods() ?: Swagger::$METHODS;
|
||||||
$httpMethods = array_map('strtolower', $httpMethods);
|
$httpMethods = array_map('strtolower', $httpMethods);
|
||||||
$validHttpMethods = array_intersect($httpMethods, Swagger::$METHODS);
|
$supportedHttpMethods = array_intersect($httpMethods, Swagger::$METHODS);
|
||||||
|
|
||||||
if (empty($validHttpMethods)) {
|
if (empty($supportedHttpMethods)) {
|
||||||
$this->logger->warning('No valid HTTP method for path', [
|
$this->logger->warning('None of the HTTP methods specified for path {path} are supported by swagger-ui, skipping this path', [
|
||||||
'path' => $path,
|
'path' => $path,
|
||||||
'methods' => $httpMethods,
|
'methods' => $httpMethods,
|
||||||
]);
|
]);
|
||||||
@ -220,7 +220,7 @@ final class SwaggerPhpDescriber implements ModelRegistryAwareInterface
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
yield $method => [$path, $validHttpMethods];
|
yield $method => [$path, $supportedHttpMethods];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user