当前位置:网站首页>swagger错误:WARN i.s.m.p.AbstractSerializableParameter - [getExample,421] - Illegal DefaultValue null
swagger错误:WARN i.s.m.p.AbstractSerializableParameter - [getExample,421] - Illegal DefaultValue null
2022-08-11 05:29:00 【zhangkai__】
在项目中引入swagger后,Spring服务器启动后显示错误:java.lang.NumberFormatException: For input string: “”
这是由于maven引入swagger依赖产生的问题:
解决方法有两种:
第一种
第二种 :直接修改pom依赖:同路径长度下,谁先声明谁优先,把1.5.21放在上面,即可排除springfox-swagger2依赖的1.5.20版本。
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<version>1.5.21</version>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
<version>1.5.21</version>
</dependency>
<!-- swagger2-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.9.2</version>
</dependency>
<!-- swagger2-UI-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
</dependency>
直接配置后,重新maven更新一下,就不会再报错了~~
还有一个小小小问题:在swagger传数据时,出现下面一个错误结果
JSON parse error: Unexpected character (’}’ (code 125)): was expecting double-quote to start field name; nested exception is com.fasterxml.jackson.core.JsonParseException: Unexpected character (’}’ (code 125)): was expecting double-quote to start field name\n at [Source: (PushbackInputStream); line: 4, column: 2]
是因为json语句中最后一行有逗号!!!
删除就好!!!!
参考其他博主链接:十分感谢
关于Java中遇到的“ For input String: "" ”这个问题的解决方案_Melo_FengZhi的博客-CSDN博客_for input string
边栏推荐
- mk文件介绍
- Day 69
- Promise 中状态改变和回调执行先后顺序 和promise多次回调
- 精彩联动 | OpenMLDB Pulsar Connector原理和实操
- js learning advanced (event senior pink teacher teaching notes)
- 2021-09-11 C语言 变量与内存分配
- js 学习进阶(Dom部分 pink老师教学笔记)
- USB 枚举过程中8 字节标准请求解析
- Intelligent risk control China design and fall to the ground
- Some formulas for system performance and concurrency
猜你喜欢
随机推荐
Minutes of OpenMLDB Meetup No.2
Event Preview | On April 23, a number of wonderful sharing sessions of OpenMLDB will come, which will live up to the good time of the weekend
The whole process of Tinker access --- Compilation
OpenMLDB官网升级,神秘贡献者地图带你快速进阶
Invalid revision: 3.18.1-g262b901-dirty
Open Source Machine Learning Database OpenMLDB Contributor Program Fully Launched
Day 76
自己动手写RISC-V的C编译器-01实现加减法
微信小程序_开发工具的安装
Matplotlib找不到字体,打印乱码
PyQt5中调用.ui转换的.py文件代码解释
Day 86
精彩联动 | OpenMLDB Pulsar Connector原理和实操
The third phase of the contributor task is wonderful
何凯明新作ViTDET:目标检测领域,颠覆分层backbone理念
Node stepping on the pit 80 port is occupied
The official website of OpenMLDB is upgraded, and the mysterious contributor map will take you to advance quickly
贡献者任务第三期精彩来袭
系统性能及并发数的一些计算公式
第一章 Verilog语言和Vivado初步使用