quicktype icon indicating copy to clipboard operation
quicktype copied to clipboard

Quicktype cannot distinguish float 0.0 from int 0

Open vtta opened this issue 4 years ago • 2 comments

The members of iodepth_level in the sample json code are floats, but quicktype recognize them as ints (IodepthLevel in the output python code)

I'm using the web app at https://app.quicktype.io/ , maybe it's caused by the type system in JavaScript?

Code is pasted here

vtta avatar Aug 07 '20 08:08 vtta

I ran into this issue as well (with any number ending with .0). This would be fine for me except Python wants to serialize .0 to a float yet the code quick type generates enforces that it is an integer.

nottheswimmer avatar Sep 10 '20 20:09 nottheswimmer

+1 experienced the same issue. Was able to work around by replacing all .0s with 0.001s.

vik748 avatar Jan 22 '24 22:01 vik748