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

Loading multiple swagger files with ReDoc #187

Closed
katschre opened this issue Jan 30, 2017 · 10 comments
Closed

Loading multiple swagger files with ReDoc #187

katschre opened this issue Jan 30, 2017 · 10 comments
Labels

Comments

@katschre
Copy link

Hello! I am looking for a solution or example for rendering multiple swagger spec files. Is there an existing/preferred solution for loading multiple swagger files, rather loading all APIs into a single yaml file (i.e. swagger.yaml in the demo code)?

@RomanHotsiy
Copy link
Member

Hey @katschre.

Check my answer to issue #163.

Let me know if it works for you or if you need any assistance.

@katschre
Copy link
Author

In your demo code, can "swagger.yaml" be dynamically changed to specific specs? If I am following correctly, your swagger.yaml contains each of the apis in the demo. I'm looking to support upwards of 80 apis with ReDoc, so the loading time would suffer if it has to render all within one file. Please let me know if I am understanding your dynamic linking incorrectly!

@jeremycohensolal
Copy link

From my point of view, since redoc is juste a simple client side app, you can create a basic HTML homepage with some links to your differents api.

Each API could be a link to a different "redoc" instance.

@RomanHotsiy
Copy link
Member

RomanHotsiy commented Jan 31, 2017

@nemenemsrouge thanks, you're absolutely correct 👍

If I am following correctly, your swagger.yaml contains each of the apis in the demo.

Probably you've mistaken something, our swagger.yaml contains spec of only ONE API with a lot of operations

@katschre summing up so far you have two options:

  • as proposed by @nemenemsrouge you can create a homepage with links to different API and each API page is another ReDoc instance. These pages may be as simple as our minimal setup demo: https://github.com/Rebilly/ReDoc#tldr each pointing to another spec
  • you can create one page with some buttons, selectbox, etc and javascript which tells redoc which spec to render. Example of this is our demo page: http://rebilly.github.io/ReDoc

I will create a few basic examples today so you can base your solution on

@RomanHotsiy
Copy link
Member

RomanHotsiy commented Jan 31, 2017

Here is an example of hosting multiple specs on the same page: https://github.com/Rebilly/ReDoc/blob/master/demo/examples/multiple-apis/index.html

@techieshark
Copy link

Update, the multi-api example is now on the gh-pages branch:

https://github.com/Rebilly/ReDoc/blob/gh-pages/examples/multiple-apis/index.html

@dbones
Copy link

dbones commented Oct 23, 2019

If it helps
created a small dashboard for presenting a catalog of services

https://github.com/dbones/ink

consider this a simple solution to this problem

@volbrene
Copy link

I have written a docker image for that problem. If you are interested, you can use it :) Feel free: https://hub.docker.com/r/volbrene/redoc

@gfiehler
Copy link

@volbrene thank you for the docker image I like how you solved this issue, would you be open to putting the source code for this in Github so we could customize it for our use?

@volbrene
Copy link

I have now published the git in Github. https://github.com/volbrene/redoc

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

No branches or pull requests

7 participants