Skip to content
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

Hoverfly templating issue with number greater than 9007199254740991 #1155

Closed
akhilasmohan opened this issue Nov 29, 2024 · 4 comments · Fixed by #1156 or #1158
Closed

Hoverfly templating issue with number greater than 9007199254740991 #1155

akhilasmohan opened this issue Nov 29, 2024 · 4 comments · Fixed by #1156 or #1158
Assignees

Comments

@akhilasmohan
Copy link

akhilasmohan commented Nov 29, 2024

Description of the bug

I am trying to get data from request to the response via templating.While trying it is observed for numbers greater than 9007199254740991 in the request , the response gets changed .
Example :
If I am passing this as the request body :
"Input": {
"inputNo1": "100",
"inputNo2": "0009007199254740999",
"inputNo3": "001"
}

Output Response:
"Output": {
"outputNo1": "100",
"outputNo2": "0009007199254741000",
"outputNo3": "1"
}

Template used : "{{ Request.Body 'jsonpath' '$.Input.inputNo2' }}"

Steps to reproduce the issue

Use the above template to extract the data from request .
Here the data is send as string and the template is also placed within "".

Observed result

Hoverfly error messages seen (If none, say none)

(paste here)

If possible, add screenshots to help explain your problem

Expected result

Additional relevant information

  1. Hoverfly version:
    | hoverctl | master-4270 |
    | hoverfly | v1.9.5
  2. Anything that might help us to diagnose the problem: Could it be due to floating-point precision limitations? What is the solution to it .
kapishmalik added a commit to kapishmalik/hoverfly that referenced this issue Nov 29, 2024
@kapishmalik
Copy link
Collaborator

@akhilasmohan raised PR for the same. @tommysitu Could you please review the same.

@akhilasmohan
Copy link
Author

akhilasmohan commented Nov 29, 2024 via email

@kapishmalik kapishmalik self-assigned this Nov 30, 2024
tommysitu pushed a commit that referenced this issue Nov 30, 2024
tommysitu added a commit that referenced this issue Nov 30, 2024
tommysitu added a commit that referenced this issue Nov 30, 2024
* Revert "better version of fix"

This reverts commit 16dd451.

* Revert "handling for big int"

This reverts commit dacd2be.

* Revert "bugfix - resolve issue #1155"

This reverts commit fa9da57.
@tommysitu tommysitu reopened this Nov 30, 2024
kapishmalik added a commit to kapishmalik/hoverfly that referenced this issue Nov 30, 2024
@kapishmalik
Copy link
Collaborator

@akhilasmohan this issue is fixed in new version 1.10.5

@akhilasmohan
Copy link
Author

akhilasmohan commented Dec 2, 2024 via email

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

Successfully merging a pull request may close this issue.

3 participants