-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Deserializing NaN #447
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
Comments
On Fri, Mar 18, 2016 at 11:20 AM, rdilipk [email protected] wrote:
This null -> 0.0 conversion is an amenity I wouldn't feel safe relying on.
ǝnɥɐuop ʎllıq |
On Fri, Mar 18, 2016 at 11:29 AM, BillyGoto [email protected]
The thing is, the Json I am dealing with itself has some meta-data that advertises the
Sorry. I am a bit confused. I currently use Json::Reader to 'parse' in the entire Json |
Yeah, Json::Reader is deprecated.
So:
... now use this reader. |
That works! Thank you very much! I somehow totally missed the deprecation notice. |
|
On Saturday, March 19, 2016, Christopher Dunn [email protected]
—
|
True, but I don't have time to change that (if you mean to add methods to the Builder for everything). If you submit a PR, you can merge it. My main concern is easy and obvious binary compatibility. |
I am dealing with some Json that is sending down NaN quoted like this: "NaN". The Json::Value::asDouble() method fails because the type of that entity is being deserialized as string and calling asDouble() on that expectedly throws. I am using 0.7.0. Two questions:
How should I handle these correctly? Should I ask upstream code to NOT quote the word NaN given that Json can't describe such entities anyway? They do send out null (no quotes) and asDouble successfully deserializes them to 0.
I see something called allowSpecialFloats which looks like what I want but it is buried under some class called OurFeatures (mirroring Features). That in turn is hidden inside json_reader.cpp. Don't I have access to that setting?
( I see this has been brought up before: #209
How do I make use of that fix?)
The text was updated successfully, but these errors were encountered: