Skip to content

Commit 27ad7b4

Browse files
authored
Merge pull request #1 from dkoston/route_sorting
add connexion pull: spec-first#1941
2 parents 7c4fcc4 + 2d992be commit 27ad7b4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

connexion/middleware/abstract.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from connexion.operations import AbstractOperation
1111
from connexion.resolver import Resolver
1212
from connexion.spec import Specification
13+
from connexion.utils import sort_routes
1314

1415
logger = logging.getLogger(__name__)
1516

@@ -85,7 +86,8 @@ def add_paths(self, paths: t.Optional[dict] = None) -> None:
8586
Adds the paths defined in the specification as operations.
8687
"""
8788
paths = t.cast(dict, paths or self.specification.get("paths", dict()))
88-
for path, methods in paths.items():
89+
for path in sort_routes(list(paths.keys())):
90+
methods = paths[path]
8991
logger.debug("Adding %s%s...", self.base_path, path)
9092

9193
for method in methods:

0 commit comments

Comments
 (0)