当前位置:网站首页>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 ;
边栏推荐
- QPushButton绑定快捷键的注意事项
- MRO industrial products enterprise procurement system: how to refine procurement collaborative management? Industrial products enterprises that want to upgrade must see!
- Three years of Android development, Android interview experience and real questions sorting of eight major manufacturers during the 2022 epidemic
- C language daily practice - day 22: Zero foundation learning dynamic planning
- Yutai micro rushes to the scientific innovation board: Huawei and Xiaomi fund are shareholders to raise 1.3 billion
- tensorflow和torch代码验证cuda是否安装成功
- 受益匪浅,安卓面试问题
- The list of people who passed the fifth phase of personal ability certification assessment was published
- R language ggplot2 visualization: use the ggdotplot function of ggpubr package to visualize dot plot, set the palette parameter, and set the colors of data points and box graphs of dot plots at differ
- Excel 中VBA脚本的简单应用
猜你喜欢

保证接口数据安全的10种方案

A full set of teaching materials, real questions of Android interview of 7 major manufacturers including Alibaba Kwai pinduoduo
![Optical blood pressure estimation based on PPG and FFT neural network [translation]](/img/88/2345dac73248a5f0f9fa3142ca0397.png)
Optical blood pressure estimation based on PPG and FFT neural network [translation]

Reptiles have a good time. Are you full? These three bottom lines must not be touched!
受益匪浅,安卓面试问题
![[depth first search] Ji suanke: Square](/img/fc/e42ae0d036be258bed5623d55fc2db.jpg)
[depth first search] Ji suanke: Square

第五期个人能力认证考核通过名单公布

Don't miss this underestimated movie because of controversy!

LeetCode-1279. 红绿灯路口

Synchronous development of business and application: strategic suggestions for application modernization
随机推荐
Word如何显示修改痕迹
Cereals Mall - Distributed Advanced p129~p339 (end)
Excel 中VBA脚本的简单应用
Take a look at how cabloyjs workflow engine implements activiti boundary events
倒计时2天|腾讯云消息队列数据接入平台(Data Import Platform)直播预告
谷粒商城--分布式高级篇P129~P339(完结)
pychrm社区版调用matplotlib.pyplot.imshow()函数图像不弹出的解决方法
Pychrm Community Edition calls matplotlib pyplot. Solution of imshow() function image not popping up
An error occurs when installing MySQL: could not create or access the registry key needed for the
Digital "new" operation and maintenance of energy industry
LeetCode-1279. Traffic light intersection
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
通俗的讲解,带你入门协程
Camel case with Hungarian notation
【pytorch】yolov5 训练自己的数据集
How word displays modification traces
Unlock 2 live broadcast themes in advance! Today, I will teach you how to complete software package integration Issues 29-30
Video based full link Intelligent Cloud? This article explains in detail what Alibaba cloud video cloud "intelligent media production" is
Master Xuan joined hands with sunflower to remotely control enabling cloud rendering and GPU computing services