-
Notifications
You must be signed in to change notification settings - Fork 9.1k
How to run swagger-ui with local code changes AND my own swagger.json? #3675
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
Comments
I think I figured it out for Place To load it automatically when opening the server, alter
to
|
@HaraldNordgren What I do is open http://localhost:3200?url=myfile.json |
None of things which I've seen so far worked for me so I've made this bash script for starting docker swagger-ui container with my host file linked (and not copied) for live updates of what I'm working on. Maybe it will be helpful for other people looking for option to preview their file edited from host (eg. some text editor you like).
What it does is essentially commenting out copy statement from docker-run.sh which makes the docker container fail to start because of copying the file specified in SWAGGER_JSON. |
@HaraldNordgren I recently struggled with the same problem and found a simple trick to solve this situation. Sharing it here - https://medium.com/@requestly_ext/check-swagger-api-specs-without-hosting-swagger-ui-934861c004de Maybe it will help you and others. But this is only helpful if you want to view specs on your machine only and not share the IP of your machine with others. But its worth looking at as it minimizes some of the development cycles. |
@HaraldNordgren Thanks! |
Make sure you are volume mounting correctly! Check out my answer in this Stack Overflow post https://stackoverflow.com/a/50264343/3838892 |
Locking due to inactivity. This is done to avoid resurrecting old issues and bumping long threads with new, possibly unrelated content. If you think you're experiencing something similar to what you've found here: please open a new issue, follow the template, and reference this issue in your report. Thanks! |
The Readme specifies that Swagger-UI can be run with your own file like this
which works I if I translate it to
This, however, ignores my local changes.
I can run my local changes with
but I can't figure out how to get this dev server to run anything else than the Petstore example.
Can anyone help me combine the two, so I can run swagger-ui with local code changes AND my own swagger.json?
The text was updated successfully, but these errors were encountered: