usebruno / bruno

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

Bruno converts decimal numbers in JSON body to strings #2438

Open mrtnbrst opened 2 weeks ago

mrtnbrst commented 2 weeks ago

I have checked the following:

Describe the bug

Bruno converts decimal numbers in JSON to strings as visible in the screenshot.

.bru file to reproduce the bug

example.json

Screenshots/Live demo link

image

mrtnbrst commented 2 weeks ago

The attached file is a .bru file, but those are not allowed to be uploaded, so I changed the file extension.

jwetzell commented 1 week ago

Seems to be an issue with "long" decimals as not all of the decimals in your example got converted to strings.

jwetzell commented 1 week ago

The problem is this line here for someone looking to fix this. It is using a library to parse the JSON but that library is converting these long decimals into "BigNumber" type. @sanjai0py is the one who added this BigNumber parsing in so might be able to speak to the reasoning or if this side-effect was not known.