-
Notifications
You must be signed in to change notification settings - Fork 470
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
Set default format to be .json. #245
Conversation
I definitely think we should have specs, some behavior has changed, right? |
It also needs a CHANGELOG and an UPGRADING entry. |
Since that change is it possible to access to the resources with the |
@whatasunnyday can you please update changelog and upgrading files? |
@dmitry Sure. |
@whatasunnyday 👍 |
@@ -1,6 +1,17 @@ | |||
Upgrading Grape-swagger | |||
======================= | |||
|
|||
### Upgrading to >= 0.10.2 | |||
|
|||
Previously, grape-swagger hide the format in the URL by default. This conflicted |
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.
hide
=> hid
I still think this needs a test! We're changing behavior, what prevents a future committer to revert it? |
I actually agree 100% but I'm quite confused the current state of the tests. The tests fail for grape 0.10.0 to 0.11.0 but pass on HEAD. Why is this? I was thinking to change https://github.com/tim-vandecasteele/grape-swagger/blob/master/spec/default_api_spec.rb, specifically: subject do
get '/swagger_doc'
JSON.parse(last_response.body)
end to subject do
get '/swagger_doc.json'
JSON.parse(last_response.body)
end but the tests pass even though I changed |
Also, the tests here should be folded into default_api_spec.rb. Update: I've removed areas in the tests that specify |
Right, we are likely missing tests around this, this is a good time to add them. With your change Grape 0.10.0, 0.11.0, etc. are broken by default. So we can't ship this, it looks like it's as simple as requesting with .json vs. without .json, but I am not 100% sure what to do about it. Either way we want this PR not to break any tests ;) |
please re-target against |
Fixes:
https://github.com/tim-vandecasteele/grape-swagger/issues/244
ruby-grape/grape-swagger-rails#11
Perhaps more. Not sure if we need any specs for this.