Bugfix
Detail
#28686
REST routing: Shorter paths are prioritized over longer paths and cause incorrect route matching
The CompareByParts comparator sorts handlers so that shorter paths are checked before longer paths. As a result, more specific routes (e.g. /kt-activities/{id}/states) are never reached, as more general routes (e.g. /kt-activities/{id}) intercept them beforehand.
Problem: return len1 - len2 in line 185 of HandlerForPath.CompareByParts.compare()
Solution: Longer, more specific paths should be checked first: return len2 - len1RetryClaude may make errors. Please check the answers.