File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
restdocs-openapi-gradle-plugin/src/main/kotlin/com/epages/restdocs/openapi/gradle Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -129,8 +129,9 @@ internal object OpenApi20Generator {
129129
130130 private fun groupByPath (resources : List <ResourceModel >): Map <String , List <ResourceModel >> {
131131 return resources.sortedWith(
132- // by path segment count first (first main resources, subresources later) - then path string
133- comparingInt<ResourceModel > { it.request.path.count { c -> c == ' /' } }
132+ // by first path segment, then path length, then path
133+ comparing<ResourceModel , String > { it.request.path.split(" /" ).firstOrNull().orEmpty() }
134+ .thenComparing(comparingInt<ResourceModel > { it.request.path.count { c -> c == ' /' } })
134135 .thenComparing(comparing<ResourceModel , String > { it.request.path }))
135136 .groupBy { it.request.path }
136137 }
You can’t perform that action at this time.
0 commit comments