Closed
Description
In Grape, if the api version is part of the path ( version 'v1', using: :path
), the grape-swagger route_match regex fails to match all paths.
To reproduce, add the following line to grape-swagger/example/api.rb below format :json
(line 7): version 'v1', using: :path
In this case, grape generates routes with paths that looks as follows: /:version/invoices
Which is not properly matched by the regex in grape-swagger/lib/grape-swagger.rb line 23 (route_match = route_match.match('\/([\w|-]*?)[\.\/\(]') || route_match.match('\/([\w|-]*)')
)