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
How to serve local file with docker #5383
Comments
I used this and it works :
To be honest, the doc is unclear about SWAGGER_JSON environment variable. |
thanks @AirDur here is docker run command
|
This page (installation.md) memtioned the SWAGGER_JSON but not in this page (configuration.md), really confusing. |
Using the above still results in showing the default Swagger Petstore example :( If setting
what URL will the file be served on? I assumed just |
I tried @AirDur solution and it works, thanks! Problem is the swagger UI always shows up with the Petstore URL in the text box. Is there a way to change it? It's annoying to change it manually every time. |
@mandreyel I had this same problem and was using the "tag latest" just like you, so I decided to test the most stable version, the v3.24.3 and the problem was solved |
As for me I keep forgetting that my browser can have a cache. |
It looks like Swagger will silently fall back to the petstore whenever the defined swagger.json can not be found. Make sure your paths and mounts are correct |
Holy Moly. This was a real blood boiler due to me thinking it would be a quick solution using their docker image... After getting the path setup correctly as mentioned by previous commentators, I still could not view my After reading this article, I was finally able to it view. Apparently it looks in the The full CLI command looked like this: On the shoulders of giants... |
Thanks a lot, this finally works! |
What a view from up here, thank you @escarborEleven! I found this worked slightly better as it loaded directly to my custom.yaml instead of starting with the Pet Store:
|
I am following the instructions to set up a docker container with a local API docs file, with an
api.yaml
file in the local repo in the folder$HOME/my-app
, and launching the container as follows:However, it returns in a 404 (
"GET /docs/api.yaml HTTP/1.1" 404 126)
.It's not clear what I'm doing wrong and any help would be appreciated.
Thanks for reading.
The text was updated successfully, but these errors were encountered: