bruno icon indicating copy to clipboard operation
bruno copied to clipboard

Bruno converts decimal numbers in JSON body to strings

Open mrtnbrst opened this issue 1 year ago • 4 comments

I have checked the following:

  • [X] I use the newest version of bruno.
  • [X] I've searched existing issues and found nothing related to my issue.

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 avatar Jun 11 '24 13:06 mrtnbrst

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

mrtnbrst avatar Jun 11 '24 13:06 mrtnbrst

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

jwetzell avatar Jun 18 '24 13:06 jwetzell

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.

jwetzell avatar Jun 18 '24 13:06 jwetzell

@sanjai0py Can you comment on this?

helloanoop avatar Aug 06 '24 07:08 helloanoop

This has been fixed as a part of PR https://github.com/usebruno/bruno/pull/2773, and will go out in the v1.27.0 release.

helloanoop avatar Aug 27 '24 09:08 helloanoop