当前位置:网站首页>Swagger2 reports an error illegal DefaultValue null for parameter type integer
Swagger2 reports an error illegal DefaultValue null for parameter type integer
2022-07-06 19:19:00 【Marketplace pomegranate awn】
1、 Error details
Development today , Automatically generated a lot javabean Code for , It contains swagger2 Annotations , As a result, the project is refreshed as soon as it starts swagger2 Just report a mistake java.lang.NumberFormatException: For input string: ""
, In fact, it has no impact on the use , But for obsessive-compulsive disorder, thieves are uncomfortable , Here is the error message ;
2022-07-05 14:24:53.538 WARN 55280 --- [nio-8888-exec-9] i.s.m.p.AbstractSerializableParameter : Illegal DefaultValue null for parameter type integer
java.lang.NumberFormatException: For input string: ""
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Long.parseLong(Long.java:601)
at java.lang.Long.valueOf(Long.java:803)
at io.swagger.models.parameters.AbstractSerializableParameter.getExample(AbstractSerializableParameter.java:412)
at sun.reflect.GeneratedMethodAccessor86.invoke(Unknown Source)
2、 Cause analysis
There are a lot of specific reasons on the Internet , Let's not talk much , In fact, that is swagger2 Its own problems , It's not about code ;
3、 Solution
Since it is swagger2 Its own problems , Not optimized , The best way is to use the optimized swagger2, That is to say, it will cause errors jar The bags are replaced :
used pom.xml file
<!-- swagger2 -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.9.2</version>
</dependency>
<!-- swagger-ui -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
</dependency>
new pom.xml file
<!-- swagger2 -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.9.2</version>
<exclusions>
<exclusion>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
</exclusion>
<exclusion>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- swagger-ui -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
</dependency>
<!-- solve swagger Report errors Illegal DefaultValue null for parameter type integer -->
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<version>1.5.22</version>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
<version>1.5.22</version>
</dependency>
PS: If it is replaced, an error will still be reported , Please re build、 Start and stop items 、 Clear cache 、MAVEN Build and so on , Because caching can lead to jar The package was not successfully replaced as desired , Don't ask me how I know ;
边栏推荐
- A wearable arm device for night and sleeveless blood pressure measurement [translation]
- Based on butterfly species recognition
- ROS自定义消息发布订阅示例
- Word如何显示修改痕迹
- C#/VB. Net to add text / image watermarks to PDF documents
- R语言ggplot2可视化时间序列柱形图:通过双色渐变配色颜色主题可视化时间序列柱形图
- 能源行业的数字化“新”运维
- 驼峰式与下划线命名规则(Camel case With hungarian notation)
- Intelligent supply chain management system solution for hardware and electromechanical industry: digital intelligent supply chain "creates new blood" for traditional industries
- usb host 驱动 - UVC 掉包
猜你喜欢
Mathematical knowledge -- code implementation of Gaussian elimination (elementary line transformation to solve equations)
[depth first search] Ji suanke: find numbers
How to type multiple spaces when editing CSDN articles
Solution of commercial supply chain management platform for packaging industry: layout smart supply system and digitally integrate the supply chain of packaging industry
Druid 数据库连接池 详解
倒计时2天|腾讯云消息队列数据接入平台(Data Import Platform)直播预告
数学知识——高斯消元(初等行变换解方程组)代码实现
助力安全人才专业素养提升 | 个人能力认证考核第一阶段圆满结束!
About static type, dynamic type, ID, instancetype
Openmv4 learning notes 1 --- one click download, background knowledge of image processing, lab brightness contrast
随机推荐
PMP每日一练 | 考试不迷路-7.6
In 50W, what have I done right?
The list of people who passed the fifth phase of personal ability certification assessment was published
Deep circulation network long-term blood pressure prediction [translation]
五金机电行业供应商智慧管理平台解决方案:优化供应链管理,带动企业业绩增长
Intelligent supply chain management system solution for hardware and electromechanical industry: digital intelligent supply chain "creates new blood" for traditional industries
Tongyu Xincai rushes to Shenzhen Stock Exchange: the annual revenue is 947million Zhang Chi and Su Shiguo are the actual controllers
Precautions for binding shortcut keys of QPushButton
[matlab] Simulink the input and output variables of the same module cannot have the same name
How to type multiple spaces when editing CSDN articles
Countdown 2 days | live broadcast preview of Tencent cloud message queue data import platform
The nearest library of Qinglong panel
Druid 数据库连接池 详解
Computer network: sorting out common network interview questions (I)
If you have any problems, you can contact me. A rookie ~
Pytorch common loss function
能源行业的数字化“新”运维
map的使用(列表的数据赋值到表单,json逗号隔开显示赋值)
R language ggplot2 visualization: use the ggstripchart function of ggpubr package to visualize the grouped dot strip plot, and set the add parameter to add box plots for different levels of dot strip
Tensorflow and torch code verify whether CUDA is successfully installed