diff --git a/openapi_core/templating/util.py b/openapi_core/templating/util.py index 863c6017..ef5dfa71 100644 --- a/openapi_core/templating/util.py +++ b/openapi_core/templating/util.py @@ -15,7 +15,7 @@ def _handle_field(self, field: str) -> Any: class PathParameter: name = "PathParameter" - pattern = r"[^\/]+" + pattern = r"[^\/]*" def __call__(self, text: str) -> str: return text diff --git a/tests/unit/templating/test_paths_finders.py b/tests/unit/templating/test_paths_finders.py index 13240112..17396d1a 100644 --- a/tests/unit/templating/test_paths_finders.py +++ b/tests/unit/templating/test_paths_finders.py @@ -217,7 +217,7 @@ def test_simple(self, finder, spec): class BaseTestVariableValid: - @pytest.mark.parametrize("version", ["v1", "v2"]) + @pytest.mark.parametrize("version", ["v1", "v2", ""]) def test_variable(self, finder, spec, version): method = "get" full_url = f"http://petstore.swagger.io/{version}/resource"