usebruno / bruno

Opensource IDE For Exploring and Testing Api's (lightweight alternative to postman/insomnia)
https://www.usebruno.com/
MIT License
26.54k stars 1.22k forks source link

JSON Response Long Conversion Loses Precision #3369

Open lcsebastian opened 1 day ago

lcsebastian commented 1 day ago

I have checked the following:

Describe the bug

Bruno serializes Long data types incorrectly. Precision is lost during the conversion. Doing a curl call to the same API shows the difference.

Bruno

Request

{{host}}/integration/used-inv-transfer-query?createdDateAfter=20241022000000.000-07:00

Response

[
  {
    "transactionNature": "PUTAWAY",
    "reasonCode": null,
    "createdDate": "2024-10-24T23:48:49.866+00:00",
    "reviewDate": null,
    "quantity": 2,
    "sku": "SKY2376-U",
    "transactionType": "ADD",
    "remarks": null,
    "id": 637437444832607700,
    "warehouseId": "1",
    "status": null,
    "kitParent": null,
    "usedParent": "SKY2376"
  },
  {
    "transactionNature": "PUTAWAY",
    "reasonCode": null,
    "createdDate": "2024-10-24T23:44:12.079+00:00",
    "reviewDate": null,
    "quantity": 1,
    "sku": "SKY3248-U",
    "transactionType": "ADD",
    "remarks": null,
    "id": 637436279256038400,
    "warehouseId": "1",
    "status": null,
    "kitParent": null,
    "usedParent": "SKY3248"
  }
]

CURL

Request

 curl --request GET   --url 'http://localhost:9095/warehouse/integration/used-inv-transfer-query?createdDateAfter=20241022000000.000-07%3A00'   --header 'Authorization: <removed>' --header 'Warehouse: 37'

Response

[{"transactionNature":"PUTAWAY","reasonCode":null,"createdDate":"2024-10-24T23:48:49.866+00:00","reviewDate":null,"quantity":2,"sku":"SKY2376-U","transactionType":"ADD","remarks":null,"id":637437444832607744,"warehouseId":"1","status":null,"kitParent":null,"usedParent":"SKY2376"},{"transactionNature":"PUTAWAY","reasonCode":null,"createdDate":"2024-10-24T23:44:12.079+00:00","reviewDate":null,"quantity":1,"sku":"SKY3248-U","transactionType":"ADD","remarks":null,"id":637436279256038427,"warehouseId":"1","status":null,"kitParent":null,"usedParent":"SKY3248"}]

.bru file to reproduce the bug

Unfortunately this is an enterprise system, so I cannot provide the exact API credentials to hit the same endpoint, but it should be trivial to write an small service that returns Long data types to illustrate the issue.

Screenshots/Live demo link

image image

helloanoop commented 1 day ago

Hey @lcsebastian ! Thanks for reporting this issue, We are working on this and will have this fixed in the upcoming release over the next few days.

helloanoop commented 1 day ago

While we continue to investigate this and see how this could be resolved, here is a workaround for users facing similar issues - https://docs.usebruno.com/advanced-guides/working-with-bigint