Unable to infer base url. This is common when using dynamic servlet registration or when the API is

Swagger弹窗报错:Unable to infer base url. This is common when using dynamic servlet registration... 一、前言 springboot集成swagger,所有配置都配置好之后,访问:http://localhost:8081/swagger-ui/index.html#/ 出现弹窗报错: 二、问题定位分析 1、 查看是否配置了拦截器,如果配置了,则放行swagger的相关请求 "/swagger-resources/**" ,"/webjars/**" ,"/v2/**" ,"/swagger-ui.html/**" 代码里未使用,此条排除 2、配置未加 看网上说的最多的就是在配置类上加 @EnableS 阅读详情

问题:
在这里插入图片描述

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:

解决办法:
让你的Application 启动类继承SpringBootServletInitializer,然后scanBasePackages包范围内都扫描,因为你可能还依赖了子项目,子项目中的配置信息也要扫描进来。

@SpringBootApplication(exclude = DataSourceAutoConfiguration.class, scanBasePackages = "com.sx.*")
public class WangDianApplication extends SpringBootServletInitializer {

    public static void main(String args[]) {
        SpringApplication.run(WangDianApplication.class, args);
    }
}
SpringBoot使用Swagger3出现Unable to infer base url.This is common when using dynamic servlet 在使用`SpringBoot`中配置`Swagger3`的时候,出现 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 av 阅读详情

相关推荐

访问Swagger页面异常 Unable to infer base url.

访问Swagger页面无法正常显示,提示如下信息: 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

Markix的博客 4016

Swagger| Unable to infer base url. This is common when using dynamic servlet registration...

问题描述: 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...

YvesHe的专栏 1万+

对比学习损失函数避坑指南:为什么你的自监督模型不收敛?

本文深入剖析对比学习损失函数中的关键陷阱,揭示自监督模型不收敛的根本原因。通过分析温度系数选择、负样本采样策略和特征归一化等核心因素,提供实用解决方案。实验数据表明,正确设置温度系数τ(建议0.07起)可提升30%性能,而MoCo风格的负样本队列比SimCLR方案在小批量时准确率高6-8%。

nokia的博客 922

Unable to infer base url. This is common when using dynamic servlet registration or when the API

在跟着尚硅谷的一个微服务做项目的时候,使用Swagger2打开浏览器一直报错,http://localhost:8080/swagger-ui.htm 首先你得保证 1、在启动类或配置类上加@EnableSwagger2注解 2、包扫描注解@ComponentScan注解,例如我的是 3、添加SwaggerConfig配置类 @Configuration//配置类 @EnableSwagger2 //swagger注解 public class SwaggerConfig { ...

axiebuzhen的博客 2962

【FnOS飞牛云 | NAS存储】旧电脑不吃灰,手把手教你搭建完全属于自己的私人网盘

打造属于自己的NAS私人网盘,亲测有效,值得一试

木子Linux的博客世界 9414

光电振荡器(OEO):从原理到应用,解锁高频微波信号新纪元

本文深入解析了光电振荡器(OEO)的核心原理与前沿应用。OEO通过巧妙的光-电-光转换机制,利用光学谐振腔产生高频、高纯度、低相位噪声的微波信号,有效突破了传统电子电路的频率瓶颈。文章详细拆解了其工作流程,并探讨了在雷达系统、高速光通信及精密测量等领域的硬核应用价值。

weixin_29231027的博客 365
上一篇: @RequestBody和@RequestParam区别
下一篇: go 语言开发环境搭建以及Hello World
She_lock
博客等级 码龄12年 157粉丝 134原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值