Skip to content

Commit 0898d87

Browse files
authored
Merge pull request #546 from python-openapi/fix/allow-empty-template-variables-fix
allow empty template variables fix
2 parents 96e103a + e682a0a commit 0898d87

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

openapi_core/templating/util.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def _handle_field(self, field: str) -> Any:
1515

1616
class PathParameter:
1717
name = "PathParameter"
18-
pattern = r"[^\/]+"
18+
pattern = r"[^\/]*"
1919

2020
def __call__(self, text: str) -> str:
2121
return text

tests/unit/templating/test_paths_finders.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ def test_simple(self, finder, spec):
217217

218218

219219
class BaseTestVariableValid:
220-
@pytest.mark.parametrize("version", ["v1", "v2"])
220+
@pytest.mark.parametrize("version", ["v1", "v2", ""])
221221
def test_variable(self, finder, spec, version):
222222
method = "get"
223223
full_url = f"http://petstore.swagger.io/{version}/resource"

0 commit comments

Comments
 (0)