Skip to content

Beautify for JSON in raw request rounds long numeric values #5658

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wiesniak opened this issue Dec 18, 2018 · 6 comments · Fixed by #8601
Closed

Beautify for JSON in raw request rounds long numeric values #5658

wiesniak opened this issue Dec 18, 2018 · 6 comments · Fixed by #8601

Comments

@wiesniak
Copy link

Describe the bug
When I use Beautify in request body text area for json, ulong value is rounded.

To Reproduce
Steps to reproduce the behavior:

  1. Open new tab
  2. Select POST request method
  3. Select "Body" tab
  4. Select "raw" radio button and "JSON (application/json)" content type
  5. Paste in text area
    {"id":8741825358579525632}
  6. Click "Beautify"
  7. See formatted JSON - it is
{
    "id": 8741825358579526000
}

Expected behavior
I expected to see

{
    "id": 8741825358579525632
}

App information:

  • Native App
  • Version 6.6.1
  • OS: Windows 10 Pro 10.0.17134
@awalland
Copy link

i'd like to add that also 0 decimal places are removed if they are unnecessary, which might not always be wanted.
beautifying the following payload:

{
  "someValue": 60.0
}

becomes

{
    "someValue": 60
}

while i agree that this shouldn't make a difference, with some APIs it does and i don't like a reformatting functionality changing my requests payload values.

@armoour
Copy link

armoour commented Apr 13, 2020

can this issue be solved this year?

@pankajk07
Copy link
Member

We have fixed this as part of v7.26. Please try it out and let's us know if you find any other issues.

@Maheshoptiva
Copy link

@arlemi still I am facing same issue about "because javascript numbers are 64 bit, with 53 bits reserved for the integer part."
it is round off the id.

@arlemi
Copy link
Collaborator

arlemi commented Mar 24, 2021

@Maheshoptiva Which version of Postman are you using? Can you share an example of id that gets rounded out?

@Maheshoptiva
Copy link

Maheshoptiva commented Mar 24, 2021

Hi @arlemi , I am using win64-8.0.7,
Response:
{
"networkQuery": {
"oTid": 2021112411030200034,
"channel": "ABC",

Script:
bodyData = JSON.parse(responseBody);
value = bodyData.networkQuery.oTid;
console.log("Value of oTid: ", value);
pm.environment.set("oTid", value);

Variable value store:
2021112411030200000

Thanks,
MB.

Hi @arlemi ,
Thanks for support, it is resolve now with another way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants