Swagger-ui doesn't pick up the context path while making calls to api-docs
djuloori opened this issue · 10 comments
Hi, I am on Springboot 2.2.6.RELEASE and i use springfox-swagger2 and springfox-swagger-ui dependencies of version 3.0.0 SNAPSHOT. I have server.servlet.context-path="/app" in my application.yaml.
After i build and deploy i am able to get the json from the url 'http://localhost:8080/app/v2/api-docs' but when i go to swagger ui at 'http://localhost:8080/app/swagger-ui.html' i get an error saying "Failed to load api definition, Fetch Error Unauthorized". When i inspect the page i see html is making a call to ''http://localhost:8080/v2/api-docs' which wont be valid. To configure the url i've set this property in bootstrap.yml 'springfox.documentation.swagger.v2.path: /app/v2/api-docs', Now i see the html making a call to right context path but the api-docs is broken. Can somebody help?
Interesting, this may be a bug, let me look at this! Thanks for reporting!
Is there an other stable version which i could use to get swagger-ui working?
that would be 2.10.5, but its not really feature complete. Its only stable from picking up the nightly changes in 3.0.0
Hmm, I'll wait until this is fixed.
This seems to be a bug in spring fox 3.0.0-SNAPSHOT, see here: springfox/springfox#3030
Looks like it is not fixed, since long time. Can we have an ETA for this? So that we could prioritize our tasks accordingly.
Thanks!
This should now be fixed in master. Please try the latest snapshot and let me know
This should now be fixed in master. Please try the latest snapshot and let me know
hi @dilipkrish
Issue still persists.
See my comment here: springfox/springfox#3030 (comment)
[Update:] With latest snapshot, even swagger-ui stopped working without context path.
None works:
http://127.0.0.1:8181/swagger-ui
http://127.0.0.1:8181/swagger-ui.html
http://127.0.0.1:8181/swagger-ui/index.html
I've responded, Please dont cross post. Thank you!
Is this solved? I am facing the same issue