-
Notifications
You must be signed in to change notification settings - Fork 56
Open
Labels
Description
JSON3 casts all floating points to integers, as long as it can be done without loss of precision.
I.e.
test = "{ \"A\": 0.0 }"
x = JSON3.read(test)
JSON3.Object{Base.CodeUnits{UInt8, String}, Vector{UInt64}} with 1 entry:
:A => 0
However this behaviour causes generated types to not work correctly:
JSON3.@generatetypes test
JSON3.read(test,JSONTypes.Root)
ERROR: ArgumentError: invalid JSON at byte position 9 while parsing type Main.JSONTypes.Root: ExpectedComma
{ "A": 0.0 }