Skip to content

Wrong value read from response.json() #5568

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
mmornati opened this issue Nov 25, 2018 · 2 comments
Closed

Wrong value read from response.json() #5568

mmornati opened this issue Nov 25, 2018 · 2 comments

Comments

@mmornati
Copy link

Describe the bug
When accessing a value from response.json() into the test script, the value is not corresponding to the one you can read on the response body into the web interface (which is the correct one).

You can see what is happening checking the following screenshots.
I tried to change the way I'm parsing the Json body (pm.response.json() or JSON.parse(responseBody) but the result is the same).
Can it be anything related to the Long value size? (which is valid in my Java API application)

Expected behavior
Values should be the same !!

Screenshots
image
image
image

App information (please complete the following information):

  • Native OSx APP: V. 6.5.2
@abhijitkane
Copy link
Member

Possibly related to #5658 - the same bug in the console

@saswatds
Copy link

Hi @mmornati, the test scripts run in a javascript sandbox and maximum values an integer can hold in javascript is +/- 9007199254740991
Currently, BigInt support in javascript is in stage-3 https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt so as and when javascript starts supporting such large integers the test scripts in Postman will also be able to.

As an alternative, we can suggest, you could perform string-based comparisons with Regular Expression using pm.response.text()

Closing this issue now.

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

No branches or pull requests

4 participants