-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 overriding version parameter #394
Conversation
Hacked on this all day and came up with this fix. Thanks for Grape, I really appreciate it! |
Hold on this, though specs are green, this issue does not appear to be entirely fixed... |
Strike that! Reverse it... (said in a Gene Wilder as Willy Wonka voice) This is ready to go, issue was header-related on my side. :-) |
Newer and simpler, and no longer breaks(!) grape-swagger :-) |
Thanks! Can you please update CHANGELOG, too? |
There're a ton of whitespace additions. I am sure you feel that it looks better, but would you mind cleaning up those, the implicit coding style is less sparse in Grape :) Nothing person, just want to minimize change. |
|
||
versions = settings[:version] | ||
|
||
version = versions.nil? ? nil : versions.join( '|' ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be written more concisely as version = versions.join('|') if versions
.
@dblock Thanks the input, I'd be more than happy to make the changes you've suggested! |
Thanks, looking forward to an update. |
OK, how's that? |
I committed a fix for this in c065f33, using your code, but without all the other unrelated changes. Let me know if I missed anything. Thx. |
Hello there fine fellows!
Beginning to use and love Grape, but have run into a serious issue which I am unable to resolve myself.
I have an endpoint described as such:
This works fine with API versioning via headers when I pass in this body:
However, when I use API versioning via path, the version parameter is set to the API version from the path, which results in a 403 with this body:
I verified this at coerce.rb by adding these lines after line 14:
This produces:
where pacioli is my API version from:
I believe this to be 100% incorrect. :-)
Let me know if I can help in any way!
P.S. The 403 is weird in itself as line 15 of coerce.rb certainly appears to throw a 400.