When trying to have an endpoint that matches dynamically except for specific keywords.
i.e.
GET resource/:id => returns the resource
GET resource/new => returns a JSON schema of the resource
The issue is that when I define it this way:
class ResourceAPI
get 'resource/:id' do
# ...
end
get 'resource/new' do
# ...
end
end
I will never hit the resource/new endpoint. However, if I define it the other way around, it will work.
When trying to have an endpoint that matches dynamically except for specific keywords.
i.e.
GET resource/:id=> returns the resourceGET resource/new=> returns a JSON schema of the resourceThe issue is that when I define it this way:
I will never hit the
resource/newendpoint. However, if I define it the other way around, it will work.