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

Swagger UI integration with swagger-blocks is confusing #54

Closed
pdurkim opened this issue Apr 23, 2016 · 9 comments
Closed

Swagger UI integration with swagger-blocks is confusing #54

pdurkim opened this issue Apr 23, 2016 · 9 comments

Comments

@pdurkim
Copy link

pdurkim commented Apr 23, 2016

Is there any way you could add more complete documentation for how to handle the Swagger UI side of things? It seems like that is the part that is missing from the instructions. The fact that it's an integral part of getting all this to work, it's crucial information. Specifically, expanding on your set up of Swagger UI and what you mean by "point Swagger UI to /apidocs and everything should just work."

@pdurkim
Copy link
Author

pdurkim commented Apr 25, 2016

nvm, got it to work!

@pdurkim pdurkim closed this as completed Apr 25, 2016
@ericpeters0n
Copy link

Agree: still confusing.

@fotinakis
Copy link
Owner

How can it be made clearer? I'm happy to accept PRs for README updates to make this clearer for people getting set up, while keeping in mind that swagger-blocks here is an unoffical third-party library, and Swagger UI is an official first-party library (so it's out of scope to include the whole Swagger UI setup process here, but integration hints would be great).

@scarroll32
Copy link

I'm on board with it being confusing. I've followed the README and now have the Swagger-format json being generated. Now what? I guess I need to set up another server for Swagger?

@biow0lf
Copy link
Contributor

biow0lf commented Feb 6, 2017

@seanfcarroll for example:

cd public
git clone https://github.com/swagger-api/swagger-ui.git
cd swagger-ui/
git checkout v2.2.10

Change url = http://petstore.swagger.io/v2/swagger.json; to url = http://localhost:3000/api/docs.json; in public/dist/index.html

Where /api/docs.json path to your swagger-blocks endpoint.

Open http://localhost:3000/dist/index.html in browser.

@scarroll32
Copy link

hi @biow0lf that's great, thank you. I also found a project that mounts it as a Rails engine: https://github.com/batdevis/swagger_engine

@gaukharaya
Copy link

@seanfcarroll do you mind explaining how you integrated swagger engine with swagger ui please?

@quarryman
Copy link

quarryman commented Sep 27, 2017

@biow0lf

Change url = http://petstore.swagger.io/v2/swagger.json; to url = http://localhost:3000/api/docs.json; in public/dist/index.html

No need to change dist/index.html
It accepts 'url' param which specifies swagger generated json url, rails endpoint in case one followed this repo manual for mounting swagger controller to 'apidocs' route of your app.

http://localhost:3000/dist/index.html?url=http://localhost:3000/apidocs

@belgoros
Copy link

belgoros commented Dec 5, 2018

@quarryman I don't know how you can have 2 servers run on the same host and port (localhost:3000). Either one need to precise that swagger-ui server should be started and point out the way to do that or it just does not work when you start your rails server in dev mode as usual with rails s, because there is no route to [GET] "/dist/index.html:
screenshot 2018-12-05 at 11 04 29

kevinchristianson pushed a commit to kevinchristianson/swagger-blocks that referenced this issue Jan 18, 2019
Added clearer setup instructions using information from issue fotinakis#54
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

8 participants