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

Path version ignored #1305

Closed
przbadu opened this issue Mar 7, 2016 · 3 comments
Closed

Path version ignored #1305

przbadu opened this issue Mar 7, 2016 · 3 comments

Comments

@przbadu
Copy link

przbadu commented Mar 7, 2016

related with #133

grape v 0.13.0 and v 0.14.0

Hi, I guess it is still reproducing. I am using https://github.com/ruby-grape/grape#path versioning with prefix 'api'

# api.rb

prefix          'api'
version         ['v2', 'v1']
format          :json
default_format  :json

mount V2::Domain::API
mount V1::Domain::API

/api/v1/passwordless/request_validation?

The requests above always returns "v2" regardless of thepath being set, and all V2 test cases passes, but v1 test cases broken.

I tried with grape version 0.13.0 and 0.14.0

Thanks

@przbadu przbadu changed the title Path version ignored - https://github.com/ruby-grape/grape/issues/133 Path version ignored Mar 7, 2016
@przbadu
Copy link
Author

przbadu commented Mar 7, 2016

well!

deleting line:

version         ['v2', 'v1']

from api.rb and moving version block into:

class V1::Domain::API < Grape::API
  version  'v1'

  .....
end
class V2::Domain::API < Grape::API
  version   'v2'

  .....
end

Fixed my problem 😄

@przbadu przbadu closed this as completed Mar 7, 2016
@dblock
Copy link
Member

dblock commented Mar 7, 2016

Right, the first syntax is not something that actually exists, it cannot guess that v1 is actually the V1 namespace by convention.

If you think the documentation is confusing, please do contribute an update. Because the syntax on the first case is actually correct, and says the parent API supports both v1 and v2 I don't think we can do anything here in code.

@przbadu
Copy link
Author

przbadu commented Mar 8, 2016

@dblock : right, I think we can update documentation for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants