Skip to content

Commit c2ec2fb

Browse files
author
Christian Marie
committed
Ignore empty resources
1 parent 857a1e8 commit c2ec2fb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/grape-swagger.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ def mount(mounts)
1111
original_mount mounts
1212
@combined_routes ||= {}
1313
mounts::routes.each do |route|
14-
resource = route.route_path.match('\/(\w*?)[\.\/\(]').captures.first || '/'
14+
resource = route.route_path.match('\/(\w*?)[\.\/\(]').captures.first
15+
next if resource.empty?
1516
@combined_routes[resource.downcase] ||= []
1617
@combined_routes[resource.downcase] << route
1718
end

0 commit comments

Comments
 (0)