html toast 错误信息,解决swagger2集成问题,404,1弹窗问题,2启动项目报错,3启动后频繁打印错误日志 /null/swagger-ui.html,...

0还有一个问题配置类容易被遗忘贴上配置类的注解!(Configuration@EnableSwagger2)

另一个时404时静态资源配置问题:

99568b8a647e?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

404需要复写MVC映射

1权限控制过程中被拦截了

Unable to infer base url. This is common when using dynamic servlet registration or when the API is behind an API Gateway. The base url is the root of where all the swagger resources are served. For e.g. if the api is available at http://example.org/api/v2/api-docs then the base url is http://example.org/api/. Please enter the location manually:

如图:

99568b8a647e?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

这个问题是因为你系统有安全鉴权导致(Shiro /Security)

解决方案:

1.放开对该页面的鉴权

99568b8a647e?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

2版本与springBoot(Spring 不兼容造成的)

解决方法:

So you're better off using 2.5.0 in both versions as it has a lot of issues fixed compared!

原文:https://stackoverflow.com/questions/38744115/no-mapping-found-for-swagger-resources-configuration-ui

Different versioning of springfox-swagger2 and springfox-swagger-ui has been an issue. In some cases, like former of 2.5.0 and latter of 2.6.1 version, the integration works fine. But, if former is of 2.6.1 and latter is of 2.4.0, then the ui becomes incompatible. Hence, I suggest if both the dependencies are taken of same version by practice, then unexpected functioning of swagger can be reduced.

中文:springfox-swagger2和springfox-swagger-ui的不同版本一直是个问题。 在某些情况下,如2.5.0之前的版本和2.6.1版本的后者,集成工作正常。 但是,如果前者是2.6.1而后者是2.4.0,则ui变得不相容。 因此,我建议如果两个依赖关系都是通过实践采用相同的版本,那么可以减少swagger的意外功能。

------------------------------------------------------------------------------------------------------------------------

io.springfox

springfox-swagger2

2.5.0

io.springfox

springfox-swagger-ui

2.5.0

------------------------------------------------------------------------------------------------------------------------

3项目没有配置项目context-path:

解决给个默认值 "/",或者配好您的context-path: /xxx

99568b8a647e?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

servr.context-path

@Configuration@EnableSwagger2

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值