bruno icon indicating copy to clipboard operation
bruno copied to clipboard

Prettify Changes JSON Data Types From Float To Int

Open DJSaunders1997 opened this issue 1 year ago • 3 comments

Hi

I'm running the latest Bruno release and I've come across an issue with running prettify converting float values to ints.

Before running prettify: image

After running prettify: image

This completely changes the datatype if there are trailing .0's which is raising validation errors by my service.

I've not tested any other datatype conversions so I'm unsure the extent of this issue.

For reference Postman's Beautify behaves how I would expect a formatter too: image image

Thanks

DJSaunders1997 avatar Apr 03 '24 14:04 DJSaunders1997

Probably because the "prettifying" is done using JSON.stringify/JSON.parse, we need to start using the lossless-json package everywhere.

Its-treason avatar Apr 03 '24 14:04 Its-treason

is there a ticket for the lossless-json work? i agree this is an important change

JohnStokes228 avatar Apr 03 '24 14:04 JohnStokes228

I've implemented the lossless-json changes in the PR #2006

DJSaunders1997 avatar Apr 04 '24 12:04 DJSaunders1997

Thanks for the PR @DJSaunders1997 ! It has been merged.

This will go out in the 1.13.0 release. Please subscribe to Discord announcement channel to stay notified on the releases.

helloanoop avatar Apr 09 '24 20:04 helloanoop