Error message


java.lang.NumberFormatException: For input string: ""

at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)

at java.base/java.lang.Long.parseLong(Long.java:702)

at java.base/java.lang.Long.valueOf(Long.java:1144)

at io.swagger.models.parameters.AbstractSerializableParameter.getExample(AbstractSerializableParameter.java:412)

at jdk.internal.reflect.GeneratedMethodAccessor278.invoke(Unknown Source)

at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.base/java.lang.reflect.Method.invoke(Method.java:566)

at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:689)

at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:755)

at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178)
Copy the code

Second, solutions

The solution is to reintroduce springfox-Swagger’s Swagger-Models JAR package in pom.xml by excluding it from springfox-Swagger

<dependency>
   <groupId>io.springfox</groupId>
   <artifactId>springfox-boot-starter</artifactId>
   <exclusions>
       <exclusion>
           <groupId>io.swagger</groupId>
           <artifactId>swagger-models</artifactId>
       </exclusion>
   </exclusions>
</dependency>
<dependency>
   <groupId>io.swagger</groupId>
   <artifactId>swagger-models</artifactId>
   <version>1.5.21</version>
</dependency>
Copy the code