Skip to content

404 Api Version Not Found when version given as a symbol #328

Closed
@jagregory

Description

@jagregory

When I specify the version as a symbol, Grape doesn't ever seem to detect the right version.

I'm on the latest master commit 371921f.

To reproduce:

class Api::V1 < Grape::API
  version :v1
  format :txt

  resource :hello do
    get do
      'hello'
    end
  end
end

GET /v1/hello yields the 404 API Version Not Found txt response. Changing version :v1 to version 'v1' fixes the issue.

This is obviously not a big issue, but it did catch me out for a while and it is inconsistent with the other methods (resource for example is happy to take symbols).

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