Open Deer292 opened 6 years ago
This must have been a behavioural change in rapidjson, which we've recently updated, but I'm pretty sure it is correct. 5
and 5.0
should be equivalent in JSON.
What server is differentiating between integers and doubles in the payload?
The JSON payload is being sent to my custom inventory server which uses JSON.net and throws an exception as it does not see 5.0
as a valid integer.
I can see that this is annoying for your circumstances, but it's not something I see as a priority to fix - util.TableToJSON is abiding to the JSON standard. That said, if I'd noticed this difference before the patch I certainly would've tried to avoid it.
Details
Integers stored in a table, upon converting to JSON become floats.
This is, to my knowledge not normal behavior and is causing numerous issues when sending JSON payloads to a server that expects strict typing.
Steps to reproduce
lua_run local test = { ["test"] = 5 } lua_run MsgN(util.TableToJSON(test)) {"val":5.0}
This has only started happening since the update put out today.