[swagger] jNumberFormatException when ApiModelProperty not set [example] valu ava.lang.NumberFormatException: For input string: "" 해결하기
카테고리 없음 2019. 7. 22. 21:38swagger2의 마지막 버전은 2.9.2로서, 최신 릴리즈로서 2018년에 릴리즈되었다. 더 이상 릴리즈는 없다.
개발하다가 이런 에러를 만났는데..
NumberFormatException when ApiModelProperty not set [example] value
java.lang.NumberFormatException: For input string: ""
이 에러에 대한 해결책으로 github에서 제시하고 있다.
https://github.com/springfox/springfox/issues/2265#issuecomment-413286451
springfox 이슈는 아니고, 내부 라이브러리 이슈라 하는데.
swagger2는 더이상 개발되고 있지 않다.
그래서 아래와 같이 변경하면 에러는 발생하지 않는다.
implementation("io.springfox:springfox-swagger2:${swagger2Version}") {
exclude group: 'io.swagger',module: 'swagger-annotations'
exclude group: 'io.swagger',module: 'swagger-models'
}
implementation "io.swagger:swagger-annotations:${oldSwagger2Version}"
implementation "io.swagger:swagger-models:${oldSwagger2Version}"
implementation "io.springfox:springfox-swagger-ui:${swagger2Version}"