-
Notifications
You must be signed in to change notification settings - Fork 3
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
Inconsistent JSON response (NaN != nan) #71
Comments
@shaneseaton should we use 'NaN' everywhere then? |
If we HAVE to use one or the other I would suggest However, I am pretty sure the JSON spec doesn't account for NaN as a response. Note, we don't use I think if it were up to me, if there was a NaN value in python, I would export it in my JSON as
or I would remove the properties from the output all together:
I have seen both used, and don't mind either, so long as consistent. The use of |
Having a quick look, this post seams to support my musings above. https://stackoverflow.com/questions/6601812/sending-nan-in-json/6602204 |
Also, I just noticed the numbers are also quoted in the JSON output suggesting they are strings!!! Drop the quotes on the numbers too. (also reduces payload size) Perhaps this done because of precision? There must be a json.dumps or something in python that does this stuff without too much of a headache. |
the use of On the numbers, we had this issue with the decimals/floats in the encoding and hit an issue with float/decimal handling. The decision was to preserve the decimal using strings. See also |
The api is returning two different values of NaN which is, if nothing else, confusing. We should create a constant and use that.
The text was updated successfully, but these errors were encountered: