Skip to content
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

API version can't take an array of versions on 0.16.2 #1400

Closed
dangnm opened this issue May 16, 2016 · 4 comments
Closed

API version can't take an array of versions on 0.16.2 #1400

dangnm opened this issue May 16, 2016 · 4 comments
Labels

Comments

@dangnm
Copy link

dangnm commented May 16, 2016

This code works

 version 'v1', using: :path, vendor: 'api'
    resource :test do
      desc "Returns pong."
      get "ping" do
        { ping: "pong" }
      end
    end

This code doesn't work but it can work on 0.15.0

 version %w(v2 v1), using: :path, vendor: 'api'
    resource :test do
      desc "Returns pong."
      get "ping" do
        { ping: "pong" }
      end
    end

Started GET "/api/v1/test/ping" for ::1 at 2016-05-16 18:50:34 +0700

ActionController::RoutingError (No route matches [GET] "/api/v1/test/ping"):
actionpack (4.2.0) lib/action_dispatch/middleware/debug_exceptions.rb:21:in call' web-console (2.2.1) lib/web_console/middleware.rb:39:incall'
actionpack (4.2.0) lib/action_dispatch/middleware/show_exceptions.rb:30:in call' railties (4.2.0) lib/rails/rack/logger.rb:38:incall_app'
railties (4.2.0) lib/rails/rack/logger.rb:20:in block in call' activesupport (4.2.0) lib/active_support/tagged_logging.rb:68:inblock in tagged'
activesupport (4.2.0) lib/active_support/tagged_logging.rb:26:in tagged' activesupport (4.2.0) lib/active_support/tagged_logging.rb:68:intagged'
railties (4.2.0) lib/rails/rack/logger.rb:20:in call' quiet_assets (1.1.0) lib/quiet_assets.rb:27:incall_with_quiet_assets'
request_store (1.2.0) lib/request_store/middleware.rb:8:in call' actionpack (4.2.0) lib/action_dispatch/middleware/request_id.rb:21:incall'
rack (1.6.4) lib/rack/methodoverride.rb:22:in call' rack (1.6.4) lib/rack/runtime.rb:18:incall'
activesupport (4.2.0) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in call' rack (1.6.4) lib/rack/lock.rb:17:incall'
actionpack (4.2.0) lib/action_dispatch/middleware/static.rb:113:in call' rack (1.6.4) lib/rack/sendfile.rb:113:incall'
sentry-raven (0.15.2) lib/raven/integrations/rack.rb:54:in call' railties (4.2.0) lib/rails/engine.rb:518:incall'
railties (4.2.0) lib/rails/application.rb:164:in call' rack (1.6.4) lib/rack/lock.rb:17:incall'
rack (1.6.4) lib/rack/content_length.rb:15:in call' rack (1.6.4) lib/rack/handler/webrick.rb:88:inservice'

How can I solve this problem temporarily before some developers fix it?

@dblock
Copy link
Member

dblock commented May 16, 2016

Did this work before? I'd write a spec for it to start.

@dblock dblock added the bug? label May 16, 2016
@dangnm
Copy link
Author

dangnm commented May 16, 2016

I upgraded from 0.15.0 to 0.16.2 and it didn't work anymore. Yes. It had worked quite well on 0.15.0.
I'm not sure but I think "#1276: Replace rack-mount with new router " caused the problem.

@raydya
Copy link

raydya commented May 17, 2016

me too, version array does not work on 0.16.2

@dblock
Copy link
Member

dblock commented May 17, 2016

Can someone please start by writing and PRing a spec for this? And do try to fix it. If you get stuck we'll help out.

304 added a commit to 304/grape that referenced this issue Jun 6, 2016
Issue ruby-grape#1400

* New spec for this case

* Update CHANGELOG
304 added a commit to 304/grape that referenced this issue Jun 6, 2016
Issue ruby-grape#1400

* New spec for this case

* Update CHANGELOG
@dblock dblock closed this as completed in 4d1883f Jun 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants