当前位置:网站首页>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 ;
边栏推荐
- 通俗的讲解,带你入门协程
- 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
- 包装行业商业供应链管理平台解决方案:布局智慧供应体系,数字化整合包装行业供应链
- Black Horse - - Redis Chapter
- PMP practice once a day | don't get lost in the exam -7.6
- 应用使用Druid连接池经常性断链问题分析
- Cereals Mall - Distributed Advanced p129~p339 (end)
- Digital "new" operation and maintenance of energy industry
- Deep circulation network long-term blood pressure prediction [translation]
- [depth first search] Ji suanke: find numbers
猜你喜欢
Abstract classes and abstract methods
AUTOCAD——中心线绘制、CAD默认线宽是多少?可以修改吗?
通俗的讲解,带你入门协程
Php+redis realizes the function of canceling orders over time
Computer network: sorting out common network interview questions (I)
能源行业的数字化“新”运维
Analysis of frequent chain breaks in applications using Druid connection pools
保证接口数据安全的10种方案
C#/VB. Net to add text / image watermarks to PDF documents
Video based full link Intelligent Cloud? This article explains in detail what Alibaba cloud video cloud "intelligent media production" is
随机推荐
Video based full link Intelligent Cloud? This article explains in detail what Alibaba cloud video cloud "intelligent media production" is
Use map function and split function to type multiple elements in one line
R语言ggplot2可视化时间序列柱形图:通过双色渐变配色颜色主题可视化时间序列柱形图
多线程基础:线程基本概念与线程的创建
Countdown 2 days | live broadcast preview of Tencent cloud message queue data import platform
pytorch常见损失函数
保证接口数据安全的10种方案
MATLAB中deg2rad和rad2deg函数的使用
Reptiles have a good time. Are you full? These three bottom lines must not be touched!
[depth first search] Ji suanke: a joke of replacement
数学知识——高斯消元(初等行变换解方程组)代码实现
Airiot IOT platform enables the container industry to build [welding station information monitoring system]
Qlabel marquee text display
黑馬--Redis篇
Estimate blood pressure according to PPG using spectral spectrum time depth neural network [turn]
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
Take a look at how cabloyjs workflow engine implements activiti boundary events
Visual Studio Code启动时提示“Code安装似乎损坏。请重新安装。”、标题栏显示“不受支持”信息的解决办法
Test technology stack arrangement -- self cultivation of test development engineers
A full set of teaching materials, real questions of Android interview of 7 major manufacturers including Alibaba Kwai pinduoduo