diff --git a/src/SchemaManager.php b/src/SchemaManager.php index 86fb628..f9b3ee5 100644 --- a/src/SchemaManager.php +++ b/src/SchemaManager.php @@ -151,7 +151,7 @@ public function findPathInTemplates(string $requestPath, &$path, &$params = []): $uriTemplateManager = new UriTemplate(); foreach ($this->getPathTemplates() as $template) { if (isset($this->definition->basePath)) { - $fullTemplate = $this->definition->basePath . $template; + $fullTemplate = rtrim($this->definition->basePath, '/') . $template; } else { $fullTemplate = $template; } diff --git a/tests/fixture/petstore-with-external-docs.json b/tests/fixture/petstore-with-external-docs.json index 9f3153d..0a4b5d6 100644 --- a/tests/fixture/petstore-with-external-docs.json +++ b/tests/fixture/petstore-with-external-docs.json @@ -20,7 +20,7 @@ "url": "https://swagger.io/about" }, "host": "petstore.swagger.io", - "basePath": "/api", + "basePath": "/api/", "schemes": [ "http" ],