File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
openapi_core/templating/paths Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 99from openapi_core .templating .paths .exceptions import (
1010 PathNotFound , OperationNotFound , ServerNotFound ,
1111)
12+ from openapi_core .templating .paths .util import template_path_len
1213
1314
1415class PathFinder :
@@ -56,7 +57,7 @@ def _get_paths_iter(self, full_url_pattern):
5657 template_paths .append ((path , path_result ))
5758
5859 # Fewer variables -> more concrete path
59- for path in sorted (template_paths , key = lambda p : len ( p [ 1 ]. variables ) ):
60+ for path in sorted (template_paths , key = template_path_len ):
6061 yield path
6162
6263 def _get_operations_iter (self , request_method , paths_iter ):
Original file line number Diff line number Diff line change 1+ from typing import Tuple
2+
3+ from openapi_core .spec .paths import SpecPath
4+ from openapi_core .templating .datatypes import TemplateResult
5+
6+
7+ def template_path_len (template_path : Tuple [SpecPath , TemplateResult ]) -> int :
8+ return len (template_path [1 ].variables )
You can’t perform that action at this time.
0 commit comments