当前位置:网站首页>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
边栏推荐
猜你喜欢
Day 75
Day 86
Thesis unscramble TransFG: A Transformer Architecture for Fine - grained Recognition
Invalid revision: 3.18.1-g262b901-dirty
Use the adb command to manage applications
微信小程序启动页的实现
The whole process of Tinker access --- configuration
虚拟机更改IP地址
Visual studio2019 配置使用pthread
heap2 (tcache attack,house of orange)
随机推荐
论文解读:GAN与检测网络多任务/SOD-MTGAN: Small Object Detection via Multi-Task Generative Adversarial Network
The official website of OpenMLDB is upgraded, and the mysterious contributor map will take you to advance quickly
jdbc接口文档参考,jdbc接口方法逻辑探究
Tinker's self-introduction
JS小技巧,让你编码效率杠杠的,快乐摸鱼
微信小程序_开发工具的安装
mysql基础总结
JNI入门
mysql basic summary
mk文件介绍
【无标题】
Jetpack之dataBinding
js 学习进阶(Dom部分 pink老师教学笔记)
Day 78
OpenMLDB: Consistent production-level feature computing platform online and offline
何凯明新作ViTDET:目标检测领域,颠覆分层backbone理念
栈stack
【Meetup预告】OpenMLDB+OneFlow:链接特征工程到模型训练,加速机器学习模型开发
OpenMLDB Pulsar Connector: Efficiently connect real-time data to feature engineering
自己动手写RISC-V的C编译器-02语法描述方法和递归下降解析