quicktype icon indicating copy to clipboard operation
quicktype copied to clipboard

Python JSON generation

Open mikeb530 opened this issue 3 years ago • 0 comments

Hello,

I ran into an issue with the generation of the class code. The generator indicated a field value of 0.0 as an int instead of a float.

I was able to add a new function: def from_float(x: Any) -> float: assert isinstance(x, float) return x

After adding this to the generated code and it worked just fine afterward!

Thanks for making this, saved me a lot of time and it is really well done.

mikeb530 avatar May 25 '22 12:05 mikeb530