swagger-core
swagger-core copied to clipboard
BUG: Long values displayed incorrectly in json response
hi, i am using following dependencies
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.7.0</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.7.0</version>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-jersey2-jaxrs</artifactId>
<version>1.5.17</version>
</dependency>
when i am making a get request with postman as follows: http://localhost:8081/hai/api/v1/findDonatorOldProjects/100000000000000614
i get the response correctly as follows:
{
"errorCode": "SUCCESS_CODE",
"errorCodeDesc": "تمت العملية نجاح",
"errorCodeValue": 0,
"response": {
"data": [
{
"id": 100000000000001478,
"name": "الرغيف الخير - الأردن"
}
]
}
}
but when i make the request with swagger ui, i get the following response
{
"errorCode": "SUCCESS_CODE",
"errorCodeDesc": "تمت العملية نجاح",
"errorCodeValue": 0,
"response": {
"data": [
{
"id": 100000000000001470,
"name": "الرغيف الخير - الأردن"
}
]
}
}
the long value 100000000000001478 is displayed incorrectly as 100000000000001470
Same problem here! I use springdoc-openapi library (uses swagger-core internally) and faced with this issue. But when I started investigate it the discussion with the maintainer brings me to this issue.
See: https://github.com/springdoc/springdoc-openapi/issues/2174
This is because js has right bound: 2^(53)-1 and java: 2^(63)-1. Seems nothing that we can really do here.