Skip to content
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 in JSON3.@generatetypes - identified Int64 instead of Float64 #262

Open
zechenhund opened this issue Jun 8, 2023 · 1 comment
Open

Comments

@zechenhund
Copy link

I think I stumbled across a bug in generating JSONTypes - some fields where identified as Int64 instead of as Float64.

The file to generate JSONTypes from is "infra_0.json". The errors occurred at fields "kmA", "kmB" and "length" where all values are written as floats (including a . inside the figure) and at "distanceFromA" where, admittedly, there is inconsistency in that some values are written as floats (with . included), but others as integers (no . included). In the case of "kmA", "kmB", "length" this seems to definitely be a bug; in the case of "distanceFromA" at least the ambiguity was not reported.

This leads to argument errors when parsing the file via JSON3.read("infra_0.json", JSONTypes.Root).

I include the original autogenerated JSONTypes in "json_types_Bug.jl", the corrected JSONTypes in "json_types.jl", and the difference in "json_types.diff".

The files are provided in JSONTypes_Bug.zip.

Best regards,
zechenhund

JSONTypes_Bug.zip

@quinnj
Copy link
Owner

quinnj commented Jun 8, 2023

cc: @mcmcgrath13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants