You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In openapi3/paths.go, InMatchingOrder consider number of variables only, assuming with the following two apis:
/v1/api/{name:.*}
/v1/api/whatever/{id}
they have the same number of variables, and the first one is lexicographical less than the second, which cause the first one matched first, while we prefer the second api matched first,
The text was updated successfully, but these errors were encountered:
In case of ambiguous matching, it's up to the tooling to decide which one to use.
If you'd like to share another algorithm, feel free to open a PR along with a test showing this behavior.
We can switch today's logic then, when both options are available to pick from for users of the lib.
Note: looks like it's only a matter of fiddling with the sort.Sort impl to also take len(ps[i]) into account, in order to impl the sorting you desire.
In
openapi3/paths.go
,InMatchingOrder
consider number of variables only, assuming with the following two apis:/v1/api/{name:.*}
/v1/api/whatever/{id}
they have the same number of variables, and the first one is lexicographical less than the second, which cause the first one matched first, while we prefer the second api matched first,
The text was updated successfully, but these errors were encountered: