-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[BUG]: Decimal numbers *.0
are converted to integers
#1768
Comments
Unfortunately, this is a well-known problem with JSON (see, for example, this note in the FHIR spec). JSON only has on number type, and most serializers throw away trailing zeros and trailing decimal points. In general, I highly recommend sending the numbers as strings if you care about the number format. Anything else is bound to break at some inconvenient time. BUT... bruno should of course cover this use-case. Currently, for json-bodies, bruno builds a JS object and then serializes it. This changes several things:
Naturally, this is what you want for proper json requests, but bruno should also be able to send slightly improper json requests! After all, it's a testing tool. One possible workaround that should work (but doesn't, because of a separate bug) is: Set the body-type to Unfortunately, there is a separate bug that sometimes (not always) encodes the body as json (see below). I think there is an existing issue for this, but I have to look it up. To see the body that bruno sends, use netcat as "echo-server": Together with the text-body + manual content-type-header trick, this leads to:
But sometimes, the result is something like this:
|
This has been fixed as a part of PR #2773, and will go out in the v1.27.0 release. |
Description
It seems that Bruno performs a conversion when a decimal number from the pattern
*.0
is sent to the API. Bruno perform a conversion to an integer which leads to some issues in our API and their behavior because it expects a decimal number and not an integer.The text was updated successfully, but these errors were encountered: