From de8704f6433a89d50e5e84cc7bbef69bd718cbd6 Mon Sep 17 00:00:00 2001 From: Floran Brutel Date: Fri, 20 Apr 2018 17:24:28 +0200 Subject: [PATCH] Better log message for unsupported http method --- Describer/SwaggerPhpDescriber.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Describer/SwaggerPhpDescriber.php b/Describer/SwaggerPhpDescriber.php index 3605cf5..e529fa9 100644 --- a/Describer/SwaggerPhpDescriber.php +++ b/Describer/SwaggerPhpDescriber.php @@ -209,10 +209,10 @@ final class SwaggerPhpDescriber implements ModelRegistryAwareInterface $path = $this->normalizePath($route->getPath()); $httpMethods = $route->getMethods() ?: Swagger::$METHODS; $httpMethods = array_map('strtolower', $httpMethods); - $validHttpMethods = array_intersect($httpMethods, Swagger::$METHODS); + $supportedHttpMethods = array_intersect($httpMethods, Swagger::$METHODS); - if (empty($validHttpMethods)) { - $this->logger->warning('No valid HTTP method for path', [ + if (empty($supportedHttpMethods)) { + $this->logger->warning('None of the HTTP methods specified for path {path} are supported by swagger-ui, skipping this path', [ 'path' => $path, 'methods' => $httpMethods, ]); @@ -220,7 +220,7 @@ final class SwaggerPhpDescriber implements ModelRegistryAwareInterface continue; } - yield $method => [$path, $validHttpMethods]; + yield $method => [$path, $supportedHttpMethods]; } } }