Swagger UI 重定向到/swagger-ui/index.html?configUrl=/v3/api-docs/swagger-config [英] Swagger UI redirecting to /swagger-ui/index.html?configUrl=/v3/api-docs/swagger-config

查看:96
本文介绍了Swagger UI 重定向到/swagger-ui/index.html?configUrl=/v3/api-docs/swagger-config的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 springdoc-openapi-ui,当我点击 http://localhost:8080/swagger-ui.html URL 它总是重定向到 http://localhost:8080/swagger-ui/index.html?configUrl=/v3/api-docs/swagger-config.有什么方法可以阻止这种重定向并在 http://localhost:8080/swagger-ui.html 上加载 swagger.html 代替.

I am using springdoc-openapi-ui, when I hit http://localhost:8080/swagger-ui.html URL it is always redirecting to http://localhost:8080/swagger-ui/index.html?configUrl=/v3/api-docs/swagger-config. Is there any way to stop this redirect and load swagger on http://localhost:8080/swagger-ui.html instead.

推荐答案

我已经在 Github 站点上提出了同样的问题.链接如下
https://github.com/springdoc/springdoc-openapi/issues/742#issue-642810354
收到其中一位贡献者的回复

I have asked the same question on Github site regarding the same. Link is provided below
https://github.com/springdoc/springdoc-openapi/issues/742#issue-642810354
Got the reply from one of the contributor

springdoc-openapi 使用内部重定向来解析必要的 swagger 资源.这就是图书馆的构建方式.
你使用你自己的swagger-ui版本,所以你可以添加你的自定义Logic,而不必依赖springdoc-openapi-ui.

这篇关于Swagger UI 重定向到/swagger-ui/index.html?configUrl=/v3/api-docs/swagger-config的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆