当前位置:网站首页>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
边栏推荐
- 论文解读:跨模态/多光谱/多模态检测 Cross-Modality Fusion Transformer for Multispectral Object Detection
- Building a data ecology for feature engineering - Embrace the open source ecology, OpenMLDB fully opens up the MLOps ecological tool chain
- Visual studio2019 configuration uses pthread
- Tinker接入全流程---配置篇
- 2021-09-11 C语言 变量与内存分配
- Day 84
- 构建面向特征工程的数据生态 ——拥抱开源生态,OpenMLDB全面打通MLOps生态工具链
- Tinker的自我介绍
- PAT乙级刷题之路
- Simple mine sweeping in C language (with source code)
猜你喜欢
8-byte standard request parsing during USB enumeration
JS小技巧,让你编码效率杠杠的,快乐摸鱼
Building a data ecology for feature engineering - Embrace the open source ecology, OpenMLDB fully opens up the MLOps ecological tool chain
OpenMLDB Pulsar Connector: Efficiently connect real-time data to feature engineering
Day 78
The Summer of Open Source 2022 is coming | Welcome to sign up for the OpenMLDB community project~
USB URB
自己动手写RISC-V的C编译器-01实现加减法
使用adb命令管理应用
Wonderful linkage | OpenMLDB Pulsar Connector principle and practical operation
随机推荐
Day 79
Jetpack之dataBinding
Day 73
Regular expression replacement for batch quick modification code
2021-09-11 C语言 变量与内存分配
Day 83
promise.all 学习(多个promise对象回调)
OpenMLDB + Jupyter Notebook: Quickly Build Machine Learning Applications
场景驱动的特征计算方式OpenMLDB,高效实现“现算先用”
使用c语言实现井字棋(有源码,可以直接运行)
Node 踩坑之80端口被占用
第一章 Verilog语言和Vivado初步使用
Building a data ecology for feature engineering - Embrace the open source ecology, OpenMLDB fully opens up the MLOps ecological tool chain
Intelligent risk control China design and fall to the ground
JVM调优整理
Dark Horse Event Project
Tinker's self-introduction
字节(byte)和位(bit)
[Meetup] OpenMLDBxDolphinScheduler engineering and scheduling link link characteristics, building the end-to-end MLOps workflow
The third phase of the contributor task is wonderful