项目配置swagger后正常使用,后台报出如下错误
2019-09-20 10:24:12.104 |-WARN [http-nio-8001-exec-1] org.springframework.web.servlet.PageNotFound [1249] -| No mapping for GET /
2019-09-20 10:24:12.125 |-WARN [http-nio-8001-exec-3] org.springframework.web.servlet.PageNotFound [1249] -| No mapping for GET /csrf
2019-09-20 10:24:12.246 |-WARN [http-nio-8001-exec-2] io.swagger.models.parameters.AbstractSerializableParameter [421] -| 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.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
解决方法
application.properties增加如下内容
logging.level.io.swagger.models.parameters.AbstractSerializableParameter=error