首页 > 编程语言 > 详细

springboot 中访问swagger提示Unable to infer base url.This is common when using dynamic

时间:2020-02-05 14:36:05      阅读:2056      评论:0      收藏:0      [点我收藏+]

错误信息:

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:

出现这种错误的原因是启动类没有扫描到swagger配置类

解决办法:

1、把swagger放到可以扫描到的包下

2、在启动类添加@ComponentScan注解扫描swagger配置类

springboot 中访问swagger提示Unable to infer base url.This is common when using dynamic

原文:https://www.cnblogs.com/aolia/p/12263158.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!