Skip to content

Commit

Permalink
Fix pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Olivier Heurtier committed Jan 19, 2024
1 parent 3fcad23 commit d54e2f3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
7 changes: 6 additions & 1 deletion sphinxcontrib/openapi/openapi30.py
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,12 @@ def openapihttpdomain(spec, **options):
for path in spec['paths']:
if ir.match(path):
new_paths.add(path)
paths = list(new_paths)
# preserve order
new_list = []
for p in spec['paths']:
if p in new_paths or p in paths:
new_list.append(p)
paths = new_list

# If no include nor paths option, then take full path
if 'include' not in options and 'paths' not in options:
Expand Down
7 changes: 6 additions & 1 deletion sphinxcontrib/openapi/renderers/_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,12 @@ def render_restructuredtext_markup(self, spec):
for entity in schemas.keys():
if ir.match(entity):
new_entities.add(entity)
entities = list(new_entities)
# preserve order
new_list = []
for i in schemas.keys():
if i in new_entities or i in entities:
new_list.append(i)
entities = new_list

# If no include nor entities option, then take full entity
if 'include' not in self._options and 'entities' not in self._options:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from sphinxcontrib.openapi import renderers


class TestOpenApi3HttpDomain(object):
class TestOpenApi3Model(object):

def test_basic(self):
renderer = renderers.ModelRenderer(None, {})
Expand Down

0 comments on commit d54e2f3

Please sign in to comment.