The Json parsed view incorrectly displays large numbers
Categories
(DevTools :: JSON Viewer, defect, P2)
Tracking
(Not tracked)
People
(Reporter: David-Pannen, Unassigned, NeedInfo)
Details
Attachments
(3 files)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36
Steps to reproduce:
Open the example JSON in Firefox and switch to JSON view.
Actual results:
Wrong numbers are displayed:
id1: 117410890614504780
id2: 117410890644643820
Expected results:
The correct numbers from the raw json are displayed:
id1: 117410890614504777
id2: 117410890644643827
Reporter | ||
Comment 1•2 years ago
|
||
Reporter | ||
Comment 2•2 years ago
|
||
Reporter | ||
Updated•2 years ago
|
Reporter | ||
Updated•2 years ago
|
Reporter | ||
Updated•2 years ago
|
Comment 3•2 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'DevTools::General' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 4•2 years ago
|
||
We use JSON.parse to get a representation for the json, and this will turn big integers into approximate values.
Note that you would get the same when using JSON.parse with such data, but maybe other languages handle this just fine.
We should check if using big numbers in JSON still is considered as valid JSON or if we should default to raw data for this. Otherwise we can try to find another way of parsing such JSON.
Updated•2 years ago
|
Comment 5•2 years ago
|
||
There's a proposal to expose the raw text to a JSON.parse function so we could transform those numbers into BigInt (See Bug 1658310)
Updated•2 years ago
|
Description
•