Swagger-UI提示Unable to infer base url. This is common when using dynamic servlet registration

一、问题描述


springfox-swagger2用的版本是2.8.0:


	io.springfox
	springfox-swagger-ui
	2.8.0


	io.springfox
	springfox-swagger2
	2.8.0


	io.springfox
	springfox-bean-validators
	2.8.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-UI提示Unable to infer base url. This is common when using dynamic servlet registration_第1张图片


二、解决方法


网上有的人说是版本过高的原因,我把他换成2.7.0也还是不行,估计是个BUG,在Chrome浏览器下会出现上图所示的错误,用360浏览器,没有问题,或者可以清理下浏览器缓存,这就很尴尬。。。

你可能感兴趣的:(WEB开发)