Skip to content

Commit

Permalink
Fix for #148 exclude logic (#149)
Browse files Browse the repository at this point in the history
  • Loading branch information
jasminelea authored Feb 13, 2024
1 parent 0c3493e commit c522e27
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions sphinxcontrib/openapi/openapi31.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,11 +473,9 @@ def openapihttpdomain(spec, **options):
# Remove paths matching regexp
if "exclude" in options:
_paths = []
for e in options["exclude"]:
er = re.compile(e)
for path in paths:
if not er.match(path):
_paths.append(path)
for path in paths:
if not any(re.match(pattern, path) for pattern in options["exclude"]):
_paths.append(path)
paths = _paths

render_request = False
Expand Down

0 comments on commit c522e27

Please sign in to comment.