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

Is there any option to load multiple swaggers in SpecUrl #605

Closed
binobose opened this issue Aug 13, 2018 · 18 comments
Closed

Is there any option to load multiple swaggers in SpecUrl #605

binobose opened this issue Aug 13, 2018 · 18 comments

Comments

@binobose
Copy link

binobose commented Aug 13, 2018

Hi, I am loading the Swagger in the below format,

<RedocStandalone
        specUrl = 'https://....../datafile.json'
        />

can anyone please let me know if there's any option to load multiple Swaggers in this context.

@RomanHotsiy
Copy link
Member

RomanHotsiy commented Aug 13, 2018

You can't load multiple swagger files at once. ReDoc doesn't support this.

Although, you can add some buttons/links/dropdown to change specUrl. Changing specUrl will update ReDoc with the corresponding spec.

You can also provide different specUrl based on the current path and have multiple pages each with the separate ReDoc instance.

Closing this issue.
Feel free to continue the discussion here!

@binobose
Copy link
Author

Thanks @RomanGotsiy for the quick response.

@J-Gonzalez
Copy link

@binobose - Did you find a clean way to get various swaggers to work? A central source for seeing all documentation for all of our microservices is what we really need. Ability to pass in multiple specUrls would be amazing, but modifying app with dropdown/links also would work fine.

@marcelstoer
Copy link

marcelstoer commented Aug 22, 2019

This is a feature request that has come up again and again (search the issues for 'multiple') e.g. #442 or #278. Most of them got closed pretty quickly as out-of-scope. That's why I didn't bother creating another one. I have the feeling at this point not even a PR to that effect would be very welcome.

I agree with @J-Gonzalez that specifying a specUrls attribute would be the sane thing to expect. That's exactly what Swagger UI does:

const ui = SwaggerUIBundle({urls: [{url: "foo.yaml",name: "Foo"},{url: "bar.yaml",name: "Bar"}], etc});
...
window.ui = ui;

@volbrene
Copy link

@binobose I have create a docker image which fix your problem: https://hub.docker.com/r/volbrene/redoc

@marcelstoer
Copy link

@volbrene Interesting, where's the code to that?

@volbrene
Copy link

At the moment the code is in my private gitlab.

@marcelstoer
Copy link

Oh, ok. Then this - from your Docker Hub page - is going to be a bit difficult 😜

You are invited to contribute new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can.

@volbrene
Copy link

Huch sorry, I have remove this part. Thanks for this info 👌

@marcelstoer
Copy link

Doing the opposite (making the repo public) would have been more helpful...Your choice of course but I would have liked to contribute new features.

@volbrene
Copy link

volbrene commented Dec 1, 2019

Which feature for example? :)

@marcelstoer
Copy link

We obviously don't have the same philosophy with regards to using and creating (open-source) software. This isn't the right place to discuss them. So, never mind.

@davinchia
Copy link

davinchia commented Jan 6, 2020

@marcelstoer want to share how you ended up solving this issue? running into the same issue right now. @volbrene's solution is fine but i would like to do this with yamls that are not hosted on the public internet, which might mean hacking/building on top of his image

@marcelstoer
Copy link

I didn't solve it yet. Doing this with a Docker image is certainly a good approach but building something closed-source around an open-source project certainly isn't.

@davinchia
Copy link

@volbrene will be helpful if you can share the code to your image!

@volbrene
Copy link

volbrene commented Jan 6, 2020

Hello guys, I have public my code: https://github.com/volbrene/redoc Hope it would be helpfull.

@davinchia
Copy link

Thanks @volbrene! Do you know if this works with local yaml files? if I package my yamls with the docker image, would that work out of the box?

@volbrene
Copy link

volbrene commented Jan 6, 2020

@davinchia I will use the offical redoc implementation. It hope this ticket helps: #149

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

6 participants