Swagger错误 SpringBoot使用Swagger2出现Unable to infer base url.
SpringBoot错误 to 出现 url unable base swagger
2023-09-14 09:14:50 时间
错误想象 :
SpringBoot使用Swagger2出现Unable to infer base url.
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:
解决方案
查看 SpringBoot的启动Application 上下文是否添加了 @EnableSwagger2 注解
@EnableSwagger2
扫描包没有添加, 进行添加
@ComponentScan(basePackages = "com.cpucode")
相关文章
- Spring学习笔记(二十一)——规范开发:SpringBoot表单验证、AOP切面编程、统一返回结果和异常处理
- 薯条 SpringBoot 在IDEA中实现热部署 (JRebel实用版)「建议收藏」
- SpringBoot 配置Mybatis两种方式
- 基于SpringBoot聊单元测试的分层
- 聊聊springboot项目如何优雅的修改或者填充请求参数
- SpringBoot+Redis 防止用户重复登录
- 4-基于SpringBoot的Web开发
- Springboot集成swagger_springboot nginx
- springboot到底是什么_Springboot注解
- SpringBoot实现并发、超发和锁机制/抢购示例:超发、乐观锁、悲观锁和Redis的使用
- 【多种情况】Springboot集成kafka-No group.id found in consumer config
- SpringBoot项目结构
- 学会SpringBoot的配置管理了,我的部署成倍提高效率?
- 看,教你手写一个最简单的SpringBoot Starter