-
Notifications
You must be signed in to change notification settings - Fork 472
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fail to show some operations when api version is part of path #192
Comments
This looks legit, would you please write a spec for this? |
Ok, will do later today or tomorrow |
I haven't had time to write a spec yet, will send a pr once I do, but I had the same problem and here's a potential fix: I say "potential" as I haven't written any specs or checked to see if this breaks anything else. The issue, for me at least, is that the second regex doesn't match index routes when the format is not in the route (as it's been explicitly declared in the given resource, e.g., Temporary workaround would also be to allow other formats, and use |
Thanks @minch, looking forward to it. |
👍 |
2 similar comments
+1 |
👍 |
Facing the same issue. When version is in url path, operations such as |
Still accepting spec + PR for a fix! :) |
Lol, sorry guys I recently started a new job and have been crazy busy the past couple weeks. I'll try to get a pr going soon.. |
Just to confirm, the fix seems to work I see the missing endpoints again after hacking the method as indicated above. I'll try to produce a failing spec. |
Additional information here: #189 |
I added the spec here https://github.com/tim-vandecasteele/grape-swagger/pull/216 |
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|-]*)')
)The text was updated successfully, but these errors were encountered: