当前位置:网站首页>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 ;
边栏推荐
- 基于蝴蝶种类识别
- Three years of Android development, Android interview experience and real questions sorting of eight major manufacturers during the 2022 epidemic
- Binary search tree
- 五金机电行业供应商智慧管理平台解决方案:优化供应链管理,带动企业业绩增长
- AIRIOT物联网平台赋能集装箱行业构建【焊接工位信息监控系统】
- 提前解锁 2 大直播主题!今天手把手教你如何完成软件包集成?|第 29-30 期
- The dplyr package of R language performs data grouping aggregation statistical transformations and calculates the grouping mean of dataframe data
- Sanmian ant financial successfully got the offer, and has experience in Android development agency recruitment and interview
- Black Horse - - Redis Chapter
- Benefit a lot, Android interview questions
猜你喜欢

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

ROS custom message publishing subscription example

Computer network: sorting out common network interview questions (I)

基于蝴蝶种类识别

倒计时2天|腾讯云消息队列数据接入平台(Data Import Platform)直播预告

Detailed idea and code implementation of infix expression to suffix expression
![Looting iii[post sequence traversal and backtracking + dynamic planning]](/img/9b/e9eeed138e46afdeed340bf2629ee1.png)
Looting iii[post sequence traversal and backtracking + dynamic planning]

渲大师携手向日葵,远控赋能云渲染及GPU算力服务

关于静态类型、动态类型、id、instancetype

Xingnuochi technology's IPO was terminated: it was planned to raise 350million yuan, with an annual revenue of 367million yuan
随机推荐
Druid 数据库连接池 详解
Airiot IOT platform enables the container industry to build [welding station information monitoring system]
Computer network: sorting out common network interview questions (I)
中缀表达式转后缀表达式详细思路及代码实现
Excel 中VBA脚本的简单应用
Pychrm Community Edition calls matplotlib pyplot. Solution of imshow() function image not popping up
【论文笔记】TransUNet: Transformers Make StrongEncoders for Medical Image Segmentation
五金机电行业智能供应链管理系统解决方案:数智化供应链为传统产业“造新血”
Implementation of AVL tree
helm部署etcd集群
R语言ggplot2可视化:使用ggpubr包的ggviolin函数可视化小提琴图
全套教学资料,阿里快手拼多多等7家大厂Android面试真题
Multithreading Basics: basic concepts of threads and creation of threads
Xingnuochi technology's IPO was terminated: it was planned to raise 350million yuan, with an annual revenue of 367million yuan
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
提前解锁 2 大直播主题!今天手把手教你如何完成软件包集成?|第 29-30 期
使用map函数、split函数一行键入多个元素
test about BinaryTree
Black Horse - - Redis Chapter
In 50W, what have I done right?