Open TigerWolf opened 8 years ago
This is just a regex error in an API declaration, no? Do you have a route that looks like the one above in the error?
It doesn't appear to be a regex error as it works with 0.15.0
. My routes:
Rails.application.routes.draw do
root 'timetable#index'
namespace :timetable do
get 'index'
end
mount Base => '/'
end
It appears that the commit that introduced this issue is: https://github.com/ruby-grape/grape/commit/9f4ba67d4aca90f04a65c5ff921b1687942eb99c
Yes, the router was replaced, it's a lot of changes. I would look at the stack that gets there or try to build a spec that reproduces this problem to start.
make sure all child mounted apis are inherited by parent grape api instead of Grape::API. For Ex
class Root < Grape::API mount Base end
class Base < Root end
@dblock is @saubi1993's comment preceding this accurate? should mounted APIs inherit from their parent class vs. Grape::API? I have never seen this documented elsewhere and am skeptical it has any practical benefit. If it does, it would be good to call this out explicilty (and loudly) in the documentation.
I think I agree with you @jnardone, @saubi1993 care to clarify?
I was having an issue, where routes were repeating twice i.e. if route path was like /api/v1/users/1/latest, rake routes was generating /api/v1/users/1/users/1/latest and before callback was executing twice before API was even executed. Doing Above resolved the issue @dblock
After upgrading to 0.16.2 from 0.15.0 I get this error:
Mustermann::CompileError - can't use the same capture name twice: "/(*:path)*path(.json)":
I have looked at the UPGRADING document and it doesn't look like I am using any of the deprecated methods.
In my
routes.rb
file I am using:mount Base => '/'
Is there any more information I can provide to help debug this issue?