Skip to content

Path based versioning not recognizing '/' route #86

Closed
@jch

Description

@jch

Path based versioning works for all routes whose paths are not the root path '/'

require 'grape'
require 'rack-test'

class API < Grape::API
  version 'v1', using: :path
  # this works fine if you change it to /hello
  get '/' do
    "I am version 1"
  end
end

include Rack::Test::Methods
def app
  API
end

get '/v1/'
# prints not found
puts "/ with path version v1: " + last_response.body
puts

get '/v1'
# also prints not found
puts "/ with path version v1: " + last_response.body
puts

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions