Skip to content

Fail to show some operations when api version is part of path #192

Closed
@carelvwyk

Description

@carelvwyk

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|-]*)'))

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions