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

trailing decimal points with a 0 are truncated. #2376

Closed
2 tasks done
mattisking opened this issue May 28, 2024 · 3 comments · May be fixed by #2382
Closed
2 tasks done

trailing decimal points with a 0 are truncated. #2376

mattisking opened this issue May 28, 2024 · 3 comments · May be fixed by #2382
Labels
bug Something isn't working

Comments

@mattisking
Copy link

I have checked the following:

  • I use the newest version of bruno.
  • I've searched existing issues and found nothing related to my issue.

Describe the bug

We have a couple of API's that require a "number" field, with data validation rules for decimal.

Currently Bruno is trimming off 0's which is a real problem for us with monetary amounts. I'm not in a position to change the validation rules.

Very quick reproducible example:
POST application/json

{
"amount": 123.00
}

Bruno sends:
{
"amount": 123
}

This breaks data validation rules for the webapi that is requiring all amounts to be in decimal format with 2 decimal points: 0.00

I can attach more here if necessary, but I honestly think that's enough. This may exist as a bug somewhere and if it does, I apologize. I searched a few ways and didn't find it.

.bru file to reproduce the bug

No response

Screenshots/Live demo link

bruno-number-truncate

Most of the relevant information is redacted but this is pretty clear I think.

@mattisking mattisking added the bug Something isn't working label May 28, 2024
@mattisking
Copy link
Author

Duplicate of #1768

@lohxt1
Copy link
Collaborator

lohxt1 commented May 31, 2024

there is a pr that is being worked on to address this issue.

meanwhile a workaround you could try is to set body as type text, and set the content-type header as json in the pre-request script

req.setHeader('content-type', 'application/json');
body_text content_type_json

@lohxt1 lohxt1 marked this as a duplicate and then as not a duplicate of #1768 Jun 14, 2024
@lohxt1
Copy link
Collaborator

lohxt1 commented Jun 14, 2024

Duplicate of #1768

@lohxt1 lohxt1 marked this as a duplicate of #1768 Jun 14, 2024
@lohxt1 lohxt1 closed this as completed Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants