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

Grape 0.9.0 and grape-swagger 0.9.0 incompatible #187

Closed
asinghrails opened this issue Dec 26, 2014 · 14 comments
Closed

Grape 0.9.0 and grape-swagger 0.9.0 incompatible #187

asinghrails opened this issue Dec 26, 2014 · 14 comments

Comments

@asinghrails
Copy link

I am using Grape gem with rails app but I am getting below error when I call grape-swagger UI.

Error : Unable to read api 'users' from path https://appname.herokuapp.com/api/swagger_doc.json/users.json (server returned undefined)

Gem:: grape 0.9.0, grape-entity 0.4.4, grape-swagger 0.9.0, rails 4.1.6, rack-cors 0.2.9

Please help me

@dblock
Copy link
Member

dblock commented Dec 26, 2014

Does that endpoint work? Does it work without .json?

@dblock dblock added the bug? label Dec 26, 2014
@asinghrails
Copy link
Author

No. It is not working without json too.
I am getting this type of error, please have a look.
http://awesomescreenshot.com/01c43sj07a

@dblock
Copy link
Member

dblock commented Dec 29, 2014

I am 99% sure this is a known bug fixed in the combination of grape 0.10.1 and grape-swagger 0.9.0, you should upgrade, but this is still an issue for the version combination of 0.9.0's.

@dblock dblock added confirmed bug and removed bug? labels Dec 29, 2014
@dblock dblock changed the title Grape-swagger + Unable to read api 'users' from path url (server returned undefined) + ruby on rails Grape 0.9.0 and grape-swagger 0.9.0 incompatible Dec 29, 2014
@asinghrails
Copy link
Author

Now I am using below version.
Using grape 0.10.1
Using grape-entity 0.4.4
Using grape-swagger 0.9.0

@asinghrails
Copy link
Author

Still it is working with below version.
gem 'grape', '> 0.7.0'
gem 'grape-swagger', '
> 0.7.2'
Thanks

@dblock
Copy link
Member

dblock commented Dec 29, 2014

Are you saying this is not working with 0.10.1 / 0.9.0 for you?

@nguyenchiencong
Copy link

+1. yes same bug with 0.10.1

@dblock
Copy link
Member

dblock commented Dec 30, 2014

I could really use a repro, maybe on top of https://github.com/dblock/grape-on-rack?

@aaronrenner
Copy link

I ran into this issue as well. Here is a rails app that reproduces the problem: https://github.com/aaronrenner/ember-contacts-backend-demo/tree/grape-swagger-issue. Fire up the rails server and visit http://localhost:3000/documentation Since I'm continuing to work on the app, make sure to check out the grape-swagger-issue tag so you can reproduce it.

dblock added a commit that referenced this issue Jan 13, 2015
@dblock
Copy link
Member

dblock commented Jan 13, 2015

@aaronrenner Just change https://github.com/aaronrenner/ember-contacts-backend-demo/blob/master/config/initializers/grape.rb#L1 from

GrapeSwaggerRails.options.url = '/api/v1/swagger_doc.json'

to

GrapeSwaggerRails.options.url = '/api/v1/swagger_doc'

And everything will work. PR: aaronrenner/ember-contacts-backend-demo#1

Can everyone on this thread check this and confirm?

I changed https://github.com/tim-vandecasteele/grape-swagger/blob/master/UPGRADING.md.

@aaronrenner
Copy link

That works. Thanks @dblock.

@nguyenchiencong
Copy link

It works! Thanks @dblock.

@dblock
Copy link
Member

dblock commented Jan 14, 2015

Closing this, thanks.

@railslauncher
Copy link

@dblock It works.

Grape 💚
GrapeSwagger 💚
GrapeSwaggerRails 💚
@dblock 💚

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

No branches or pull requests

5 participants